Modbus Connection Only Reading Tags as 0

I'm trying to read some tags with a Modbus TCP connection. I don't know much about Modbus TCP and might be missing something obvious. When I initially configure the connection, the status cycles between connected and disconnected. Once I add a few addresses in, the status stays connected. If I remove them, the status cycles again. When I try to read these tags, they get read as 0. I know that their values should not be 0. This is how I have configured the addresses:


I tried tracing the driver and can see that I am receiving messages:
Received message: [ 23 4C 00 00 00 07 00 03 04 6E D7 42 83 ]
I'm not sure what these messages mean, if anything. Any ideas on why the tags are reading as 0? With other Modbus TCP connections, I have been able to not manually set any addresses, establish a stable connection, and just use OPC tags with the addresses I want. Let me know if any further info would be helpful.

Can you share the rest of the logs?

It looks like a continuous loop of these messages:

ReadHoldingRegistersRequest 06Sep2024 10:17:52 Sending message: [ 01 90 00 00 00 06 00 03 00 79 00 02 ]
BasicRequestCycle 06Sep2024 10:17:52 Sending PendingRequest[ScheduledRequest[com.inductiveautomation.xopc.drivers.modbus2.requests.ReadHoldingRegistersRequest@3d772a5e]] request
BasicRequestCycle 06Sep2024 10:17:52 Adding request to queue: PendingRequest[ScheduledRequest[com.inductiveautomation.xopc.drivers.modbus2.requests.ReadHoldingRegistersRequest@3d772a5e]]
BasicRequestCycle 06Sep2024 10:17:51 deliverMessage() for request=PendingRequest[ScheduledRequest[com.inductiveautomation.xopc.drivers.modbus2.requests.ReadHoldingRegistersRequest@21644254]]ReceiveAction=Done
BasicRequestCycle 06Sep2024 10:17:51 Posting ScheduledRequest[com.inductiveautomation.xopc.drivers.modbus2.requests.ReadHoldingRegistersRequest@21644254] request to queue with delay 984ms.
ReadHoldingRegistersRequest 06Sep2024 10:17:51 Received message: [ 01 8F 00 00 00 07 00 03 04 00 00 00 00 ]
BasicRequestCycle 06Sep2024 10:17:51 deliverMessage() for request=PendingRequest[ScheduledRequest[com.inductiveautomation.xopc.drivers.modbus2.requests.ReadHoldingRegistersRequest@21644254]] key=399
ModbusDriver2 06Sep2024 10:17:51 key=399, message=[B@2e5b12ee
ModbusDriver2 06Sep2024 10:17:51 Received 13 [ 01 8F 00 00 00 07 00 03 04 00 00 00 00 ]
SocketIODelegate 06Sep2024 10:17:51 [hostname=192.xxx.xxx.xx ,port=502] Sending ByteBuffer [ 01 8F 00 00 00 06 00 03 08 33 00 02 ]
ReadHoldingRegistersRequest 06Sep2024 10:17:51 Sending message: [ 01 8F 00 00 00 06 00 03 08 33 00 02 ]
BasicRequestCycle 06Sep2024 10:17:51 Sending PendingRequest[ScheduledRequest[com.inductiveautomation.xopc.drivers.modbus2.requests.ReadHoldingRegistersRequest@21644254]] request
BasicRequestCycle 06Sep2024 10:17:51 Adding request to queue: PendingRequest[ScheduledRequest[com.inductiveautomation.xopc.drivers.modbus2.requests.ReadHoldingRegistersRequest@21644254]]
BasicRequestCycle 06Sep2024 10:17:51 deliverMessage() for request=PendingRequest[ScheduledRequest[com.inductiveautomation.xopc.drivers.modbus2.requests.ReadHoldingRegistersRequest@3d772a5e]]ReceiveAction=Done
BasicRequestCycle 06Sep2024 10:17:51 Posting ScheduledRequest[com.inductiveautomation.xopc.drivers.modbus2.requests.ReadHoldingRegistersRequest@3d772a5e] request to queue with delay 962ms.
ReadHoldingRegistersRequest 06Sep2024 10:17:51 Received message: [ 01 8E 00 00 00 07 00 03 04 00 C7 00 7C ]

I've obscured the IP address, but the log is filtered to only show messages regarding the problem device.

Your device is returning 0s for the addresses you're reading.

Maybe you're off by one in the address, or have the wrong unit id?

The initial connection status is suspicious to me, are you sure you have the connection configure correctly to begin with?

What type of device are you trying to read tags from? Can you share more about your configuration?

As someone who recently set up my first set of Modbus TCP tags, I need to point out for anyone who (like me) was unfamiliar: Modbus TCP != TCP != TCP/IP, so triple check that the device you're trying to connect to actually supports the protocol you're trying to use.

It is extremely common for Modbus TCP devices to terminate idle connections, typically after ten seconds. So if no tag is configured, or not fast enough, getting bumped off by the device is perfectly normal.

Oh, interesting. I had no idea that was the case. When I set up mine the connection stayed valid even without tags configured.

Sidenote: I see your name all over the place, and you've helped me solve countless problems. Thanks for all your help, I'll have to send you a tip one of these days :wink:

I'm trying to connect to a 9220 Process Controller. I was directed to read the tags off of it using Modbus TCP by the original integrator. The connection is pretty simple, I just entered the IP address and used Modbus TCP as the communication protocol. I was given a few different registers to read by the integrator (MB122, MB2100, and MB2102). I've tried addressing these a number of ways, but can't get the correct values out. Various changes (data type of tag in Ignition, not querying certain tags in Ignition, data type in address) will break the connection. Not sure where to go here, any advice?

Abandon the address configuration tool you show in your first post. It is unnecessary and makes it hard for us to help you. Just manually create Ignition OPC tags using the OPC Item Syntax for manual addressing: Note that leaving out the node address prefix implies 0.xxx with IA's driver.

Start by configuring one 16-bit integer holding register for which you know the live value. If possible with the device's own tools, it can help to preload a range of 16-bit registers with a series of integers, and target that range for your experiments.

Study the docs for your device to see if you need one-based or zero-based addressing. Adjust the Ignition-side device properties accordingly.

After you get that one tag working, delete/disable it and get one 32-bit integer address working. This will tell you if you need the swap words device settings.

Then delete/disable that one, and get one 32-bit float address working.

Finally, try multiple tags running at once. If there is a gap in the addressing the the device won't respond to, having tags running on either side of that might yield errors. Try turning off Ignition's "span gaps" setting in that case.

Many devices have there own naming convention inside their world. You must translate to the bare Modbus protocol's expectations as IA's driver implements it.

As Mr. Turmel said below, try one at a time.

I'm not 100% sure I've got the right manual, but I found the following which says

The 9220’s Modbus registers can be used as input variables in the equations without restriction. To
protect the instrument, Modbus registers are restricted as output registers.
Modbus registers are designated by an upper or lower case “M” followed by a number. "

Series-9220-Operations-and-Calibration-Manual - Page 144

Are you sure that your "MB" designation for the register is correct?