# MODBUS Holding Registers and Coils

**URL:** <https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [March 9, 2022, 5:09pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023 "2022-03-09T17:09:17Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcolson1590](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mcolson1590](https://forum.inductiveautomation.com/u/mcolson1590)\
**Post date:** [March 9, 2022, 5:09pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/1 "2022-03-09T17:09:17Z")

</div>

We have a new program were we are getting bad values on MODBUS tags for both coils and holding registers. We have no issues with reading input registers. We’re comparing the project to one we had in 7.0 which had no issues. Tags are set for R/W and Read Only is set to False for the OPC Connection. Any suggestions for further troubleshooting?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/c/dcdeed1c242511d7150629336b084ac60c71fbe4.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/a/5ab550b8a75d556c1f628064729f6e15e89ea321.png)

---

<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:** [March 9, 2022, 5:14pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/2 "2022-03-09T17:14:15Z")

</div>

Look for log entries for the particular device(s).

---

<div class="post-metadata">

**Author:** ![mcolson1590](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mcolson1590](https://forum.inductiveautomation.com/u/mcolson1590)\
**Post date:** [March 9, 2022, 5:23pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/3 "2022-03-09T17:23:47Z")

</div>

I’m getting the following.  
ReadHoldingRegistersRequest 09Mar2022 11:15:04 Received response with ExceptionCode: 0x02 (IllegalDataAddress).

If I change [ModbusTCP]HRF01 to [ModbusTCP]IRF01 and try to read an input register, the tag works. I can confirm that both exist in the PLC.

---

<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:** [March 9, 2022, 5:28pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/4 "2022-03-09T17:28:18Z")

</div>

> [@mcolson1590](#):
>
> IllegalDataAddress

That message is only possible if the PLC actively rejected that address. (Either of the two addresses that comprise a float.) Look closer at the PLC.

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [March 9, 2022, 5:30pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/5 "2022-03-09T17:30:08Z")

</div>

Also, its important to understand that Input registers occupy an entirely different memory location than holding registers. By changing HRF to IRF you are accessing something entirely different.

---

<div class="post-metadata">

**Author:** ![mcolson1590](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mcolson1590](https://forum.inductiveautomation.com/u/mcolson1590)\
**Post date:** [March 9, 2022, 5:44pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/6 "2022-03-09T17:44:43Z")

</div>

Understood. I’ve confirmed it’s not the PLC because I can access the holding register 40001 using modpoll  
modpoll -m tcp -t 4:float -r 1 -c 1 172.16.0.3  
It’s the only holding register.  
I’m also able to access the coils using modpoll but not ignition.

---

<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:** [March 9, 2022, 5:55pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/7 "2022-03-09T17:55:04Z")

</div>

Use Wireshark to spot the configuration differences.

For example Modpoll defaults to slave/unit 1 by default, Ignition defaults to 0.

---

<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:** [March 9, 2022, 6:04pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/8 "2022-03-09T18:04:29Z")

</div>

> [@Kevin.Herron](#):
>
> For example Modpoll defaults to slave/unit 1 by default, Ignition defaults to 0.

This is one of the few spots where I think the Ignition default is wrong. Slave address "0" is defined to be the broadcast address. My [alternate implementation](https://inductiveautomation.com/moduleshowcase/module/automation-professionals-llc-advanced-modbus) defaults to address 1.

---

<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:** [March 9, 2022, 6:16pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/9 "2022-03-09T18:16:05Z")

</div>

> [@pturmel](#):
>
> Slave address “0” is defined to be the broadcast address. My [alternate implementation](https://inductiveautomation.com/moduleshowcase/module/automation-professionals-llc-advanced-modbus) defaults to address 1.

Actually for Modbus TCP (as opposed to serial) you've got it wrong.

The "Modbus Messaging Implementation Guide" recommends using 0xFF or 0x00 for Modbus TCP, both accepted as a "non-significant" value that can be used for direct communication with the device.

---

<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:** [March 9, 2022, 7:00pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/10 "2022-03-09T19:00:43Z")

</div>

Hmmm. Found it. Interesting. I have to admit I find that segment of the implementation guide to be less than satisfying. Particularly the statement: “On TCP/IP, the MODBUS server is addressed using its IP address; therefore, the MODBUS Unit Identifier is useless. The value 0xFF has to be used.” This statement comes right after describing how the unit identifier could/would be used in a bridge device.

I think I’ll stick to a default “1”.

What does Ignition default to for Modbus RTU and Modbus RTU over TCP drivers?

---

<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:** [March 9, 2022, 7:03pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/11 "2022-03-09T19:03:49Z")

</div>

> [@pturmel](#):
>
> What does Ignition default to for Modbus RTU and Modbus RTU over TCP drivers?

Zero still because those came later and were derived from the TCP driver, and because the unit/slave is specified in the address and the address parser is entirely unaware of what driver variation it's parsing for.

---

<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:** [March 9, 2022, 7:07pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/12 "2022-03-09T19:07:42Z")

</div>

> [@Kevin.Herron](#):
>
> the address parser is entirely unaware of what driver variation it’s parsing for

mine, too. (:

I also wanted my Server implementation to provide a consistent view of multiple units worth of data regardless which transport is used (including _simultaneous_ access by divergent transports).

---

<div class="post-metadata">

**Author:** ![mcolson1590](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mcolson1590](https://forum.inductiveautomation.com/u/mcolson1590)\
**Post date:** [March 9, 2022, 8:18pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/13 "2022-03-09T20:18:52Z")

</div>

Wireshark indeed shows unit 1 for Modpoll and 0 for Ignition.

In lieu of using [ModbusTCP]C04, I had to use [ModbusTCP]1.C04. Is there a way to do this globally instead of tag by tag?

---

<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:** [March 9, 2022, 8:19pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/14 "2022-03-09T20:19:22Z")

</div>

No.

---

<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:** [March 9, 2022, 9:37pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/15 "2022-03-09T21:37:31Z")

</div>

> [@mcolson1590](#):
>
> Is there a way to do this globally instead of tag by tag?

Switch drivers.

{ / Shameless self-promotion. }

---

<div class="post-metadata">

**Author:** ![mcolson1590](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mcolson1590](https://forum.inductiveautomation.com/u/mcolson1590)\
**Post date:** [March 10, 2022, 1:08pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/16 "2022-03-10T13:08:54Z")

</div>

lol, do tell. Something must have changed in Ignition because I’m using the same PLCs (Micro850) and I didn’t have to add the “1.” in 7.9. I also still don’t understand why Ignition doesn’t communicate to the native tags in these PLCs when every other SCADA or HMI that I’ve used does.

---

<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:** [March 10, 2022, 1:17pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/17 "2022-03-10T13:17:29Z")

</div>

> [@mcolson1590](#):
>
> I also still don’t understand why Ignition doesn’t communicate to the native tags in these PLCs when every other SCADA or HMI that I’ve used does.

The Micro8xx family doesn't follow Rockwell's published data access manual's rules, and includes pure CIP data types not supported by other Logix processors. Ignition's driver pretty strictly follows the rules.

I'm working on a client driver in my Ethernet/IP module that handles generic CIP data access and unbrowsed symbolic tag access. Hit a roadblock, so alpha will be in April.

---

<div class="post-metadata">

**Author:** ![mcolson1590](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mcolson1590](https://forum.inductiveautomation.com/u/mcolson1590)\
**Post date:** [March 10, 2022, 2:12pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/18 "2022-03-10T14:12:07Z")

</div>

Awesome. I saw that Kepserver may be able to be used so I was going to possibly give that a try.

---

<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:** [March 10, 2022, 2:20pm UTC](https://forum.inductiveautomation.com/t/modbus-holding-registers-and-coils/57023/19 "2022-03-10T14:20:41Z")

</div>

Yeah, Kepware has a Micro850-specific driver.

It’s still vaguely on our roadmap (or more like my wishlist) but because you can currently get connected via Modbus it just keeps getting de-prioritized for other drivers and projects.
