# I can't write to a Modbus device (PLC Pro-face)

**URL:** <https://forum.inductiveautomation.com/t/i-cant-write-to-a-modbus-device-plc-pro-face/56936>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [March 7, 2022, 10:02pm UTC](https://forum.inductiveautomation.com/t/i-cant-write-to-a-modbus-device-plc-pro-face/56936 "2022-03-07T22:02:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hector\_Aaron\_Mani\_La](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@Hector\_Aaron\_Mani\_La](https://forum.inductiveautomation.com/u/Hector_Aaron_Mani_La)\
**Post date:** [March 7, 2022, 10:02pm UTC](https://forum.inductiveautomation.com/t/i-cant-write-to-a-modbus-device-plc-pro-face/56936/1 "2022-03-07T22:02:57Z")

</div>

Hi everyone;

I am trying to set to one the tag “TestActivation” that is HR:23.00.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/c/9c9e9fe70c1f05fab11ee476f8d7641d44c98653.png)

In the Pro-face PLC is the Bit address 400023.00. When I click on the value from the tag browser  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/1/c122ab5d0617733685527bbd6ccd10acd344b241.png)

I get this error:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/a/8ac7a1833ea2db1486a5f3c970e45cdbe45d6c34.png)

The Communication in the designer is read/write and from the gateway (Opc \> OPC connections options) is not set to read only.

Thanks for your support

---

<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:** [March 7, 2022, 10:05pm UTC](https://forum.inductiveautomation.com/t/i-cant-write-to-a-modbus-device-plc-pro-face/56936/2 "2022-03-07T22:05:58Z")

</div>

There should be an error in the gateway logs that might give you more information, like if the device responded with a Modbus ExceptionCode.

---

<div class="post-metadata">

**Author:** ![Hector\_Aaron\_Mani\_La](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@Hector\_Aaron\_Mani\_La](https://forum.inductiveautomation.com/u/Hector_Aaron_Mani_La)\
**Post date:** [March 7, 2022, 10:09pm UTC](https://forum.inductiveautomation.com/t/i-cant-write-to-a-modbus-device-plc-pro-face/56936/3 "2022-03-07T22:09:41Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/0/70b5593e1487af8b65b89186d1b269c24b401422.png)  
That’s what I get

---

<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:** [March 7, 2022, 10:12pm UTC](https://forum.inductiveautomation.com/t/i-cant-write-to-a-modbus-device-plc-pro-face/56936/4 "2022-03-07T22:12:53Z")

</div>

Ok, so your Modbus device doesn’t support the function code that allows individual bits to be written to.

You’ll have to use some kind of workaround where you read, mask, and write the whole register back.

One approach using a derived tag is discussed here: [Troubles making a Derived Boolean Tag work as a mask for a Short Tag - #2 by Kevin.Herron](https://forum.inductiveautomation.com/t/troubles-making-a-derived-boolean-tag-work-as-a-mask-for-a-short-tag/15203/2)

Another that uses scripting here: [Modbus UA - #5 by Travis.Cox](https://forum.inductiveautomation.com/t/modbus-ua/2159/5#p14351)

---

<div class="post-metadata">

**Author:** ![Hector\_Aaron\_Mani\_La](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@Hector\_Aaron\_Mani\_La](https://forum.inductiveautomation.com/u/Hector_Aaron_Mani_La)\
**Post date:** [March 7, 2022, 10:14pm UTC](https://forum.inductiveautomation.com/t/i-cant-write-to-a-modbus-device-plc-pro-face/56936/5 "2022-03-07T22:14:25Z")

</div>

Ok thanks a lot, I’ll read that
