Modbus TCP Communication Issues

This post is a continuation of my previous post, where I was having issues talking to a Modbus RTU device. Old post here: Modbus Communication Issues

I am using a Modbus TCP to RTU gateway. I am using the Modbus TCP driver in Ignition.

I have been able to read some values from the Modbus RTU device, but struggle to find a configuration which allows me to read all the values I need.

As an example - here is a tag configuration from the old iFix system which has been working with the Modbus device for years.

The I/O address of this tag is moscad.device0.013571.

When I create this tag in Ignition, and try to manually address with opcItemPath = ns=1;s=[moscad]1.DI3571, I get bad quality. I'm getting exception code 0x04 (Slave Device Failure).

I'm not sure where this issue is arising. This is me trying to get several devices working together, and having some trouble.

In particular - the modbus device is a MOSCAD RTU. The device is over 10 years old, and the programming software is no longer available, so I'm kind of working with a black box. Still - the fact that I can see the tags in iFix and not in Ignition is really bothering me.

Perhaps you should use wireshark to see what iFix is doing.

That's true. The old iFix system is using a direct serial connection through a USB-to-serial adapter with no modbus gateway. Still, there should be some other software which allows me to monitor the traffic.

Appreciate the response.

There are serial sniffer tools that can capture those packets.

Are you certain it's RS-232 and not RS-485? Most of the Modbus serial stuff I've used has be RS-485, but I would make sure. Possibly check your serial adapter it was using to see what mode of serial communications it was using.

Do you currently have any other DI tags addressed, or just this one?

ns=1;s=[moscad]1.C13571

The moscad address appears to be a coil, not a discrete input.

I believe it's discrete input because there are addresses in iFix with start with prefix 00, as in 003571 would be the coil address for the original one I posted.

Edit: I see what you're saying now, as in the address should actually be 13,571, not 3,571.

Appreciate the response @jay

I'm sure it's RS-232. There are three ports on the front of that MOSCAD controller - one labeled RS-485 (unused) and then the other two are RS-232C.

I had created a program which converted all the old iFix tags, so I had a couple hundred DI tags created. I could see about 20 live values, or 20 tags where I was not getting bad quality, modbus exception codes, etc.

Before this, I was manually addressing the tags, but still running into errors. I am no Modbus expert, so it could certainly be me using the wrong addresses.

Have you tried using any of the available Modbus scanner tools to see if you can read those addresses to confirm that at least something can read them?

Also, not sure how much it matters, but is your driver set up in Ignition as Modbus TCP or Modbus RTU over TCP? That might make a difference, but I really don't know for certain.

In Modbus, the first digit of an address indicates its datatype, nothing else. Your Moscad address is 013571. The first digit is a zero. This is a coil. If it were a discrete input the address would be 113571.

Try disabling the "Span Gaps" setting for the Modbus driver.