# Modbus TCP Read Write

**URL:** <https://forum.inductiveautomation.com/t/modbus-tcp-read-write/48556>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [July 7, 2021, 4:11am UTC](https://forum.inductiveautomation.com/t/modbus-tcp-read-write/48556 "2021-07-07T04:11:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaurav.Shitole](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gaurav.shitole/32/72050_2.png) [@Gaurav.Shitole](https://forum.inductiveautomation.com/u/Gaurav.Shitole)\
**Post date:** [July 7, 2021, 4:11am UTC](https://forum.inductiveautomation.com/t/modbus-tcp-read-write/48556/1 "2021-07-07T04:11:52Z")

</div>

Hello there,

I read posts from other users for read/write Modbus and found they either had issue writing in multiple registers or writing into bit of single register.

In my case I am able to read _32 bit signed real_ values and Discrete Input values. I am able to write into Coil also.  
Thing is I am trying to write into _32 bit signed real_ or _16 bit unsigned integer_. However as soon as I add the tag into ignition, the other tags which I am reading goes into BAD state. The value goes RED.  
Reading values behaves GOOD, when I delete the newly added tag for WRITE.  
Write tag also shows BAD Quality, however I am able to write in it. The value I put can be seen in Schneider software, but in Ignition it says BAD Quality and does not read value.  
Please see below snips,

Before adding WRITE tag:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/b/1b6ac811f528018d6fe3e53b053b885554d34afe.png)

After adding WRITE tag

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/2/527bc6b7f2549bfc1e0a0f7d448ab32ea326a98f.png)

Logs:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/f/df944c0ba2952ecea2c739f4243516dffadcafaf.png)

Also I verified that there is _32 bit unsigned Real_ available at register 24

---

<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:** [July 7, 2021, 12:56pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-read-write/48556/2 "2021-07-07T12:56:41Z")

</div>

This sounds like the device doesn’t emulate empty registers. For efficiency, the driver will combine nearby reads into one larger read when the gaps are small. But many devices choke on that. There is a setting in Ignition’s driver called “Span Gaps” that you can turn off to prevent this optimization.

---

<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:** [July 7, 2021, 12:58pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-read-write/48556/3 "2021-07-07T12:58:51Z")

</div>

Also, you say the 32-bit value is at register 24, but your OPC item is HRF12. That should be HRF24, based on your description. (HRF24 uses registers 24 & 25.)
