Author Topic: Read ControlLogix Serial Number  (Read 1353 times)

Dean

  • Newbie
  • *
  • Posts: 7
    • View Profile
Read ControlLogix Serial Number
« on: April 02, 2017, 10:58:33 AM »
Hi Archie,
Is it possible to read the serial number of ControlLogix plc with AdvancedHMI driver ?
I found this article on Internet where the CIP messages for that are described. - http://www.plctalk.net/qanda/archive/index.php/t-39940.html 
So can I somehow send these CIP messages through the AHMI driver ?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Read ControlLogix Serial Number
« Reply #1 on: April 02, 2017, 01:43:31 PM »
Using the same concept as described here, but reading a UDINT in attribute 6:

http://advancedhmi.com/documentation/index.php?title=Reading_the_CIP_Identity_of_any_Ethernet/IP_device

You DataReceived would be something like this:

Code: [Select]
Private Sub EthernetIPforMicro800Com1_DataReceived(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles EthernetIPforMicro800Com1.DataReceived
       If e.ErrorId = 0 Then
           If e.TransactionNumber = AttributeReadTNS Then
               Dim SerialNumber As UInt32
               SerialNumber=BitConverter.ToUInt32(e.RawData, 0)
               MsgBox(SerialNumber)
           End If
       End If
   End Sub

Dean

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Read ControlLogix Serial Number
« Reply #2 on: April 03, 2017, 03:34:18 PM »
Thank you for the answer. I didn't know that you have created documentation.
The sample from the article works correctly. However, the code snippet about the serial number doesn't work.  _driver.BeginGetAttributeSingle(1, 1, 6); It returns an array - 142,0,0,0,23,235, 61, 0

By the way I found another public method - _driver.ListIdentity(500); It returns Serial Number: 4058050 while my actual serial number is 003DEB17.

What am I missing ?

-----
I just found the answer. In order to get the serial number I need the last four digits from e.RawData
After that I have to convert them to hexadecimal and to concatenate them starting from the last to the first one.
« Last Edit: April 03, 2017, 04:16:06 PM by Dean »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Read ControlLogix Serial Number
« Reply #3 on: April 03, 2017, 04:48:46 PM »
An important detail I missed mentioning is that the example says to use the Micro800 driver which does not do any routing. So if you use that driver, you will get a serial number of the Ethernet device and not the processor.