# Modbus TCP Tag Error : Null Value

**URL:** <https://forum.inductiveautomation.com/t/modbus-tcp-tag-error-null-value/37912>\
**Category:** Ignition\
**Created:** [August 19, 2020, 2:01pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-tag-error-null-value/37912 "2020-08-19T14:01:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rochd.abdelilah](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@rochd.abdelilah](https://forum.inductiveautomation.com/u/rochd.abdelilah)\
**Post date:** [August 19, 2020, 2:01pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-tag-error-null-value/37912/1 "2020-08-19T14:01:12Z")

</div>

Hello everyone,  
I hope this will find you well!

I’m trying to connect to a Modbus TCP enabled battery to retrieve data from it. I checked first the good connection through the tool “Simply Modbus”. As it can be noticed, the communication has succeed and the data have been well transmitted.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/7/a737adf99d9a4108b11783eda01ae0c77d8880d7.png)

However, when I created OPC server tags using Modbus TCP driver in ignition, I always find null values (note that the device is well connected) :

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/9/294f121ec5098c1f1b66dd1779dc525245d7e2c1.png)

The OPC item path that I use is for instance:  
[Battery]226.HR259  
226 is the UnitID, 259 is the modbus address for the variable “Battery Voltage”.

Could anyone help me please to fix this problem.  
Thanks!

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [August 19, 2020, 2:13pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-tag-error-null-value/37912/2 "2020-08-19T14:13:31Z")

</div>

Function code 03 is IR not HR so try [Battery]226.IR259

---

<div class="post-metadata">

**Author:** ![rochd.abdelilah](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@rochd.abdelilah](https://forum.inductiveautomation.com/u/rochd.abdelilah)\
**Post date:** [August 19, 2020, 2:44pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-tag-error-null-value/37912/3 "2020-08-19T14:44:30Z")

</div>

@MatrixEngineering it unfortunately doesn’t work!  
Note that in Simply Modbus for example, functions 03 and 04 give the same results.

---

<div class="post-metadata">

**Author:** ![allnet](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@allnet](https://forum.inductiveautomation.com/u/allnet)\
**Post date:** [August 19, 2020, 3:01pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-tag-error-null-value/37912/4 "2020-08-19T15:01:41Z")

</div>

Delete any other tag related to 226, try HR260, unclick span gaps and see.

---

<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:** [August 19, 2020, 3:25pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-tag-error-null-value/37912/5 "2020-08-19T15:25:39Z")

</div>

Simply Modbus is also using 0-based addressing, so either configure the device in Ignition that way as well or add 1 to the addresses you’re using.

---

<div class="post-metadata">

**Author:** ![rochd.abdelilah](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@rochd.abdelilah](https://forum.inductiveautomation.com/u/rochd.abdelilah)\
**Post date:** [August 19, 2020, 3:38pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-tag-error-null-value/37912/6 "2020-08-19T15:38:43Z")

</div>

@allnet It works well. Thanks very much!

---

<div class="post-metadata">

**Author:** ![rochd.abdelilah](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@rochd.abdelilah](https://forum.inductiveautomation.com/u/rochd.abdelilah)\
**Post date:** [August 19, 2020, 3:39pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-tag-error-null-value/37912/7 "2020-08-19T15:39:31Z")

</div>

@Kevin.Herron Yeah absolutely. This was exactly the source of the issue. Thank you Kevin!
