I am trying to connect a new device using Modbus to a system that's been operational for 8 years and has been updated several times. I've used this device on other systems without issue. I have a UDT that I've used before that's connected and it's polling several data points. What's interesting is that if I change the tag group on one of the tags it will usually connect and stay connected. Sometimes I have to do it a few times. Once connected, it will stay connected for a long time. If I power cycle either the device or server, or if I disable the Modbus connection, then it won't reconnect. I have a wireshark file that might be useful, but I don't see a way to upload it. Any ideas? I have also set up Ignition on my laptop and if I connect it to the device, everything works fine. The modbus driver is 7.1.54. The system is running Ignition 8.1.50. Do I need to update the Modbus driver?
How big is the wireshark file? Try zipping and uploading here. If too big though, you'll have to host it elsewhere and send a link
AMMPS working.pcapng (86.8 KB) The file is not big, so I uploaded it. ip.addr == 172.21.43.210
Correction, it's Ignition 8.1.54, so I believe the modbus module is the correct version.
In the wireshark file, the first 15 seconds are where it's not connecting properly. After that, I changed the tag group and it started working.
Does anybody have any ideas what to look at next?
Look at configuration settings for your device (not in Ignition). It seems that it closes the TCP connection if there's no traffic/requests from Ignition within 2 seconds.
There's also some spontaneous responses earlier in the capture with no matching request. Not sure what that's about.
Thanks for the reply. The device is a black box that converts proprietary CAN bus data into Modbus TCP. We can't change any of its settings and I believe early on with this device we were told that it would disconnect if data wasn't requested every second or two. The Tag Group used for the UDT tags in Ignition are set to 1,000 ms. it has worked for other gateways, but this one doesn't work. What's odd is if I change the tag group to a different one, then back to the default one, then it works fine. However, once it restarts or the device powers off and on, then it won't stay connected.
Probably just lucky with timing.
The Modbus driver, and other drivers of that vintage (old AB drivers, old Siemens driver) based on the legacy driver framework, have a ~2 second delay between the connection being established and the polling starting. There's nothing that can change this.
Got it. Thanks for the information. Knowing that, I can write a script to kick start it when it breaks. A bit clunky, but it should work. Interesting that at our other site this has worked for years. As you said, must be lucky timing. Something on that server triggers at 1.99 seconds instead of 2.01 seconds.
I'll contact the vendor to see if they can extend the timeout at all.
10 or 15 seconds is the standard for most Modbus devices I've ever seen.
Huh. Never noticed this. My alternate driver doesn't do this (but has a fixed 15-second reconnect delay).
The history/decision behind this behavior has been lost to time. It's certainly not something I'd do in a new driver, and not anything newer drivers do.
What alternative driver? Is this something I can use?
Is the tag group not writable? I have found that I can connect to this device most of the time by changing the tag group. I wrote a simple script to change the tag group if data isn't being retrieved and got a "[Bad_AccessDenied("Tag is Read-Only")]" Script is system.tag.writeBlocking(['[default]Multifunction Meter/AMMPS Test/kW.tagGroup'], ['Default']). I've been successful writing to the history enabled attribute of a tag. Is tag group not something that can be changed via script?
Can anybody tell me if the tag group of a tag can be changed via scripting? I have seen that if I change the tag group on a tag, I will generally be able to connect to these meters.
You cannot use system.tag.write*() with read-only tags. You have to use system.tag.configure() to manipulate the properties of such tags. (Presumably with merge mode, so you don't have to include anything else in the config.)