# Modbus Connection Only Reading Tags as 0

**URL:** <https://forum.inductiveautomation.com/t/modbus-connection-only-reading-tags-as-0/95644>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [September 6, 2024, 5:41pm UTC](https://forum.inductiveautomation.com/t/modbus-connection-only-reading-tags-as-0/95644 "2024-09-06T17:41:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pico\_Sankari](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@Pico\_Sankari](https://forum.inductiveautomation.com/u/Pico_Sankari)\
**Post date:** [September 6, 2024, 5:41pm UTC](https://forum.inductiveautomation.com/t/modbus-connection-only-reading-tags-as-0/95644/1 "2024-09-06T17:41:55Z")

</div>

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:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/a/aac55f99b7e3400b3f6c0eff457842b97d88fb94.png)  
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.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 6, 2024, 5:47pm UTC](https://forum.inductiveautomation.com/t/modbus-connection-only-reading-tags-as-0/95644/2 "2024-09-06T17:47:01Z")

</div>

> [@Pico\_Sankari](#):
>
> 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]

Can you share the rest of the logs?

---

<div class="post-metadata">

**Author:** ![Pico\_Sankari](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@Pico\_Sankari](https://forum.inductiveautomation.com/u/Pico_Sankari)\
**Post date:** [September 6, 2024, 6:07pm UTC](https://forum.inductiveautomation.com/t/modbus-connection-only-reading-tags-as-0/95644/3 "2024-09-06T18:07:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 6, 2024, 7:00pm UTC](https://forum.inductiveautomation.com/t/modbus-connection-only-reading-tags-as-0/95644/4 "2024-09-06T19:00:08Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Philip\_Knowlton](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@Philip\_Knowlton](https://forum.inductiveautomation.com/u/Philip_Knowlton)\
**Post date:** [September 6, 2024, 8:17pm UTC](https://forum.inductiveautomation.com/t/modbus-connection-only-reading-tags-as-0/95644/5 "2024-09-06T20:17:03Z")

</div>

> [@Pico\_Sankari](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 6, 2024, 8:23pm UTC](https://forum.inductiveautomation.com/t/modbus-connection-only-reading-tags-as-0/95644/6 "2024-09-06T20:23:43Z")

</div>

> [@Philip\_Knowlton](#):
>
> The initial connection status is suspicious to me

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.

---

<div class="post-metadata">

**Author:** ![Philip\_Knowlton](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@Philip\_Knowlton](https://forum.inductiveautomation.com/u/Philip_Knowlton)\
**Post date:** [September 6, 2024, 8:26pm UTC](https://forum.inductiveautomation.com/t/modbus-connection-only-reading-tags-as-0/95644/7 "2024-09-06T20:26:48Z")

</div>

> [@pturmel](#):
>
> It is extremely common for Modbus TCP devices to terminate idle connections, typically after ten seconds

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 😉

---

<div class="post-metadata">

**Author:** ![Pico\_Sankari](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@Pico\_Sankari](https://forum.inductiveautomation.com/u/Pico_Sankari)\
**Post date:** [September 6, 2024, 10:23pm UTC](https://forum.inductiveautomation.com/t/modbus-connection-only-reading-tags-as-0/95644/8 "2024-09-06T22:23:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 6, 2024, 10:45pm UTC](https://forum.inductiveautomation.com/t/modbus-connection-only-reading-tags-as-0/95644/9 "2024-09-06T22:45:32Z")

</div>

> [@Pico\_Sankari](#):
>
> 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.

> **[Modbus Addressing | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/opc-ua/opc-ua-drivers/modbus/modbus-addressing)**
>
> Manually Addressing a Modbus Device

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.

---

<div class="post-metadata">

**Author:** ![Philip\_Knowlton](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@Philip\_Knowlton](https://forum.inductiveautomation.com/u/Philip_Knowlton)\
**Post date:** [September 6, 2024, 11:55pm UTC](https://forum.inductiveautomation.com/t/modbus-connection-only-reading-tags-as-0/95644/10 "2024-09-06T23:55:07Z")

</div>

> [@Pico\_Sankari](#):
>
> 9220 Process Controller

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](https://www.supersystemseurope.com/wp-content/uploads/2016/11/Series-9220-Operations-and-Calibration-Manual.pdf) - Page 144

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