# Error : Modbus Exception 2 : Illegal Data Address

**URL:** <https://discourse.nodered.org/t/error-modbus-exception-2-illegal-data-address/62093>\
**Category:** General\
**Created:** [3 May 2022 03:29 UTC](https://discourse.nodered.org/t/error-modbus-exception-2-illegal-data-address/62093 "2022-05-03T03:29:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam\_r](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sam\_r](https://discourse.nodered.org/u/sam_r)\
**Post date:** [3 May 2022 03:29 UTC](https://discourse.nodered.org/t/error-modbus-exception-2-illegal-data-address/62093/1 "2022-05-03T03:29:01Z")

</div>

Dear all,

I am trying to use Modbus Read to read an address data.  
Its strange that this error comes because before making working on Nodered I tested the address on Modbus poll and it shows the value. But with Nodered its showing address error which I am sure address is right.

I am attaching the screen shots of the settings i made but I write down here too for easy reading.

**Error** Modbus Exception2: Illegal Data address ( I doubt that my address is wrong as I tested in Modbus poll.

**Read Node Setting** - FC 3: Read Holding Register, Address : 845 , Quantity : 1, Poll rate : 1 second ( I tried with changing the quantity from 1 to different values like 2 ,3 4, 5 but still same error)

**Modbus Client Node Setting** - Type : Serial Expert , Serial Port : COM3, Serial Type : RTU Buffered, Baud Rate : 9600 , Data Bits : 8 , Stop Bits : 1, Parity : Even  
(Serial Type I tried RTU also but same result)

In Modbus Poll same setting have been tested before proceeding to Nodered and work perefectly.  
screen shot of modbus poll also attached.

Please guide me with your expert advice.

 ![error](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/2/e29a05fb402a182d874e712c3bbd2f30fb121310.png)  
 ![Nodered 1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/a/ea8016d2ba31ebb6dc4b593bd5c418eb8f2862fb.png)  
 ![Nodered 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/6/56a95fec933c5e430641542641cb398f2dcf48d1.png)  
 ![Modbuspoll 1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/f/3ffe2011b26b2888655af67ea0ef0aff85a9f39d.png)  
 ![Modbus poll 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/9/6995cbf082dd0f47642db171c677b648c5233952.png)

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [3 May 2022 11:10 UTC](https://discourse.nodered.org/t/error-modbus-exception-2-illegal-data-address/62093/2 "2022-05-03T11:10:35Z")

</div>

Hello .. im not an expert with Modbus but i notice in your Modbus Poll software that you used the hex address instead of decimal ..

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/1/a1bc07b285668c97f07a107ae0f0c94d615fd1f1.png)

the modbus nodes dont have that option and you must use the **decimal** value of the register address.  
**2118** or **42118** have you tried that ?

---

<div class="post-metadata">

**Author:** ![AsHex\_66](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ashex_66/32/31151_2.png) [@AsHex\_66](https://discourse.nodered.org/u/AsHex_66)\
**Post date:** [4 May 2022 07:55 UTC](https://discourse.nodered.org/t/error-modbus-exception-2-illegal-data-address/62093/3 "2022-05-04T07:55:50Z")

</div>

Good pick up, Hex != dec. Give this a go 😉 And sometimes a 1 offset will give grief as well.

---

<div class="post-metadata">

**Author:** ![sam\_r](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sam\_r](https://discourse.nodered.org/u/sam_r)\
**Post date:** [4 May 2022 09:06 UTC](https://discourse.nodered.org/t/error-modbus-exception-2-illegal-data-address/62093/4 "2022-05-04T09:06:11Z")

</div>

wow thanks yes its working now...

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 May 2022 09:06 UTC](https://discourse.nodered.org/t/error-modbus-exception-2-illegal-data-address/62093/5 "2022-05-18T09:06:47Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
