# Help with Received response with ExceptionCode: 0x02 (IllegalDataAddress)

**URL:** <https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485>\
**Category:** Ignition\
**Created:** [May 7, 2021, 5:12pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485 "2021-05-07T17:12:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [May 7, 2021, 5:12pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/1 "2021-05-07T17:12:30Z")

</div>

This error is clogging up my log files and I can’t see much useful info about it other than the driver it’s coming from (hovering over the looking glass); there are no details offered; no specific tag.

How do I get to the bottom of this?

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [May 7, 2021, 6:06pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/2 "2021-05-07T18:06:39Z")

</div>

I turned on TRACE level for drivers.ModbusDriver2.ReadCoilsRequest in the logger settings and now see a little more info before the error event:

Received message: [05 1C 00 00 00 03 00 81 02]  
Sending message: [05 1C 00 00 00 06 00 01 00 14 03 36]

The Sending/Received [DATA] is different before each error event.

Looking at the _Modicon Modbus Protocol Reference Guild_, I’m not sure how to decode this.

---

<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:** [May 7, 2021, 6:26pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/3 "2021-05-07T18:26:12Z")

</div>

This is a request for 822 coils starting from coil 20.

In the logs on the gateway is there a little magnifying glass thing on the right of the log entry that shows a “device-name” key and value?

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [May 7, 2021, 6:29pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/4 "2021-05-07T18:29:04Z")

</div>

Yes, so it just shows me which PLC/Device this is: device-name RTU01.

So how can I know exactly which 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:** [May 7, 2021, 6:30pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/5 "2021-05-07T18:30:21Z")

</div>

You can’t, but you know the range now.

You probably have one tag defined as C20, another as C842, and maybe some in between. The driver is trying to read all of these coils in a single request instead of multiple requests, but whatever device you’re talking to is saying that some or all of these addresses are invalid.

You can disable this grouping behavior by disabling the “Span Gaps” option on the device at the cost of some performance due to increased request count.

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [May 7, 2021, 6:39pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/6 "2021-05-07T18:39:45Z")

</div>

So if I turn off Span Gaps, each error message should resolve to a specific coil?

If so, can you give me the secret decoder ring for the response byte codes?

---

<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:** [May 7, 2021, 6:40pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/7 "2021-05-07T18:40:41Z")

</div>

> **[Modbus\_Application\_Protocol\_V1\_1b.pdf](https://modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf)**
>
> 320.73 KB

The first 7 bytes are a header, the rest are a request or response.

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [May 7, 2021, 7:40pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/8 "2021-05-07T19:40:31Z")

</div>

So that’s better than the manual I have.

Let me see if I can make sense of it.

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [May 7, 2021, 8:20pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/9 "2021-05-07T20:20:39Z")

</div>

I found a handy online secret decoder ring here: [Online Modbus RTU Parser & Modbus TCP Parser](https://rapidscada.net/modbus/ModbusParser.aspx)

Parses the Modbus byte codes.

I exported my tag list, searched through it, and found none of the offending addresses. Furthermore, I have very few Coils (located EBOOL’s) ; only 20 - 52. Most of my addressing is through HR’s located at the start of some UDT, and any bit I need inside of that is read usning the HR.BIT notation.

So I’m really stumped at how to connect these errors so some offending 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:** [May 7, 2021, 8:21pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/10 "2021-05-07T20:21:42Z")

</div>

What are the coil addresses you do have?

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [May 7, 2021, 8:33pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/11 "2021-05-07T20:33:15Z")

</div>

I can’t be sure this is the complete list, as it’s just a pain to go through this, but what I’ve seen so far are:

558  
758  
600  
642  
800  
841  
842

---

<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:** [May 7, 2021, 8:35pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/12 "2021-05-07T20:35:38Z")

</div>

Unless you’re lucky and 841 or 842 is just past the boundary of valid values in that device you may have to turn the Span Gaps settings to false.

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [May 7, 2021, 8:38pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/13 "2021-05-07T20:38:49Z")

</div>

I already tried that.

---

<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:** [May 7, 2021, 8:40pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/14 "2021-05-07T20:40:24Z")

</div>

When it was disabled did you find any bad quality coil tags?

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [May 7, 2021, 8:42pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/15 "2021-05-07T20:42:50Z")

</div>

Is there some easy,fast way to check without expanding every darned UDT?

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [May 7, 2021, 8:52pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/16 "2021-05-07T20:52:57Z")

</div>

I used Tag Search … searched all tags, none with bad quality.

Also, if I try to locate offending addresses in the PLC, it will not let me; saying address not configurable.

---

<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:** [May 7, 2021, 9:37pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/17 "2021-05-07T21:37:36Z")

</div>

Not sure of any shortcut to finding them.

Sanity check: with Span Gaps disabled the error messages stop or the request/response bytes at least change, right?

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [May 7, 2021, 9:40pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/18 "2021-05-07T21:40:20Z")

</div>

Is seems that even with Span Gaps disabled, the error messages do not stop and req/resp bytes do not change.

---

<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:** [May 7, 2021, 9:45pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/19 "2021-05-07T21:45:01Z")

</div>

Well… the simplest explanation for that is that you disabled it for the wrong Modbus device.

---

<div class="post-metadata">

**Author:** ![wpmccormick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wpmccormick/32/13940_2.png) [@wpmccormick](https://forum.inductiveautomation.com/u/wpmccormick)\
**Post date:** [May 7, 2021, 9:53pm UTC](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485/20 "2021-05-07T21:53:20Z")

</div>

Sorry, no simple explanation then. Let’s start looking for a more complicated explanation.

[Next page](https://forum.inductiveautomation.com/t/help-with-received-response-with-exceptioncode-0x02-illegaldataaddress/46485.md?page=2)
