# Can't Write OPC Tag - illegal data address

**URL:** <https://forum.inductiveautomation.com/t/cant-write-opc-tag-illegal-data-address/63063>\
**Category:** Ignition\
**Created:** [August 16, 2022, 6:55pm UTC](https://forum.inductiveautomation.com/t/cant-write-opc-tag-illegal-data-address/63063 "2022-08-16T18:55:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Lopez](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@David\_Lopez](https://forum.inductiveautomation.com/u/David_Lopez)\
**Post date:** [August 16, 2022, 6:55pm UTC](https://forum.inductiveautomation.com/t/cant-write-opc-tag-illegal-data-address/63063/1 "2022-08-16T18:55:18Z")

</div>

Hello, i'm trying to write a DeepSea8610's device slave address register, through a Modbus TCP connection. however, when I try to write a new value I got "Illegal Data Address" over the logger info. I've already checked the OPC client connection configuration to disable the read only statement, I've turn off the span gaps option, I've turn on "Force Multiple Register Writes" tonusea Modbus Function 16

 ![IMG-20220816-WA0007](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/a/6a706aa9f708cb6b32d1aaa013974111237b0ab1.jpeg)

---

<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 16, 2022, 7:13pm UTC](https://forum.inductiveautomation.com/t/cant-write-opc-tag-illegal-data-address/63063/2 "2022-08-16T19:13:29Z")

</div>

Do you have documentation that shows what register you should be writing to? Can you get a Wireshark capture?

From the logs it looks like it’s already using Write Multiple Registers, so that’s probably not the issue.

---

<div class="post-metadata">

**Author:** ![David\_Lopez](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@David\_Lopez](https://forum.inductiveautomation.com/u/David_Lopez)\
**Post date:** [October 18, 2022, 4:12pm UTC](https://forum.inductiveautomation.com/t/cant-write-opc-tag-illegal-data-address/63063/3 "2022-10-18T16:12:23Z")

</div>

Hi Kevin, these are the registers, I have to calculate the real registers based on the offset and page shown in the documentation.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/d/dde4eecc95e079268c939fd9eedce3ff1d6cb686.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/5/a5fac8877ae86ad0a068c49002f0c7c3ca038121.png)  
The problem is that I need to write the value on register offset 8 and its compliement on 9.  
Calculating the real holding registers are 4104 and 4105  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/1/014954fabae0a7ed41fb41715740881a74fc35b3.png)  
I needed to add 1 because of the 1-base configuration so they will be 4105 and 4106.  
I tried also to write HRI4105 but I got the same error.

Could you help me please?

---

<div class="post-metadata">

**Author:** ![David\_Lopez](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@David\_Lopez](https://forum.inductiveautomation.com/u/David_Lopez)\
**Post date:** [October 18, 2022, 4:16pm UTC](https://forum.inductiveautomation.com/t/cant-write-opc-tag-illegal-data-address/63063/4 "2022-10-18T16:16:03Z")

</div>

These are the values I should be able to write

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/1/514174d64f9d55312bf0ae8b060a26c70be50346.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:** [October 18, 2022, 8:39pm UTC](https://forum.inductiveautomation.com/t/cant-write-opc-tag-illegal-data-address/63063/5 "2022-10-18T20:39:59Z")

</div>

You will not be able to create Ignition OPC tags for any of the registers that are marked **write-only**. For those, you will need to use the `system.opc.write*()` functions directly. You probably won't have any problems with spanned gaps based on that formula (the gaps are too big to span anyways).

---

<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:** [October 18, 2022, 8:45pm UTC](https://forum.inductiveautomation.com/t/cant-write-opc-tag-illegal-data-address/63063/6 "2022-10-18T20:45:02Z")

</div>

> [@David\_Lopez](#):
>
> The problem is that I need to write the value on register offset 8 and its compliement on 9.

Given the value for offset 8 is in a python variable named `sysCtlKey`, you would do something like this:

```auto
system.opc.writeValues('Ignition OPC UA Server',
  ['[devName]HRUS4105', '[devName]HRUS4106],
  [sysCtlKey, ~sysCtlKey])

```

---

<div class="post-metadata">

**Author:** ![David\_Lopez](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@David\_Lopez](https://forum.inductiveautomation.com/u/David_Lopez)\
**Post date:** [October 19, 2022, 4:02pm UTC](https://forum.inductiveautomation.com/t/cant-write-opc-tag-illegal-data-address/63063/7 "2022-10-19T16:02:00Z")

</div>

It works ! Thank you very much

---

<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:** [April 12, 2024, 1:36pm UTC](https://forum.inductiveautomation.com/t/cant-write-opc-tag-illegal-data-address/63063/8 "2024-04-12T13:36:58Z")

</div>

Split this topic on April 12, 2024, 1:36pm UTC

A post was split to a new topic: [Write to Deepsea Panel](https://forum.inductiveautomation.com/t/write-to-deepsea-panel/88736)
