For those that might be interested, I took the Device Diagnostics project on the exchange and turned it into something more. It now displays PLC offline events in a day and the minutes along with battery status plus summarizes the types of older Rockwell PLC's to the current Logix types. This can be modified to your PLC types. I also created a couple of UDT's that generate the data you see on the page and it no longer just relies on the gateway info but much more. I was able to tie all my plants to one project and read the tags from each to display all my PLC status in one location. Not bragging, just offering if someone wants it.
Will you be posting this on the Exchange?
I would like to send it to someone and have them go through it using the UDT's I made. It's not a complete project in itself like a lot of stuff in the exchange. You have to build your tags out to make it work. However, I can modify the code to automatically create the tags needed, you would just have to provide the tag provider name.
I also have code that will create your PLC gateway devices from a spreadsheet.
That would be fun project. I think this will be a great utility where it can be used.
At my last job, I replaced Kepware with Ignition and I got a lot of utility from listDevices
My current job, all devices are Kepware. I get 0 rows from:
deviceList = system.device.listDevices()
print deviceList.rowCount
I can get some details from Kepware 'connected' tags but nothing as useful as what you have built.
I will share my global script I use to extract the info tomorrow.
def getDevicesDrivers():
deviceDS = system.device.listDevices()
data = []
for row in range(deviceDS.getRowCount()):
name = deviceDS.getValueAt(row, "Name")
data.append({
"Name": name,
"Driver": deviceDS.getValueAt(row, "Driver"),
"IPAddress": system.device.getDeviceHostname(name)
})
return data
``
You can take this and use some code to do what you want with the results for each device connection.
Just note that this will only work when run on a backend gateway (i.e. a gateway that has the device connections). If you have a split architecture, then you'll need to be running this via gw message handlers.
Also note, if you do need more info than the system.device.* functions can collect, such as driver-specific configuration, you can read this from the device json configuration files directly stored on the gateway. This can let you set this info as well
e.g.
Yes, I run that on all my gateways then put it in instances of a UDT that I use to store all the info for each device then use MQTT to transfer the instance data to a central gateway that I then turn into another Perspecitve view to display all sites. By doing it this way I can see real time data about my statuses, battery dispositions, key positions on the PLC's and how often they drop off network and for how long each day which is also historized and graphed when troubleshooting is required.
Don't forget that device connection status and ip address tags are already there under the managed System tag provider which holds Ignition's connection status
Yep, that's where I get my status from and decide if it is connected or not and if an email alert is required. I also have something built in for when the PLC shows connected but is no longer browsing the tags and getting updated values. SLC and Micrologix PLC's have that issue especially after a disconnect and reconnect. IP addresses don't show in the system tags, at least not 8.1.53 that I am using.

Ah, for IP address I might have been thinking of the diagnostics tags from the opc ua server..


