AdvancedHMI Software
General Category => Support Questions => Topic started by: Dean 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 ?
-
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:
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
-
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.
-
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.