# Write to bit in Word/DWord (Tag Browser) Siemens OPC UA server

**URL:** <https://forum.inductiveautomation.com/t/write-to-bit-in-word-dword-tag-browser-siemens-opc-ua-server/61869>\
**Category:** Ignition\
**Created:** [July 13, 2022, 7:20pm UTC](https://forum.inductiveautomation.com/t/write-to-bit-in-word-dword-tag-browser-siemens-opc-ua-server/61869 "2022-07-13T19:20:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Delfien\_De\_Witte](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Delfien\_De\_Witte](https://forum.inductiveautomation.com/u/Delfien_De_Witte)\
**Post date:** [July 13, 2022, 7:20pm UTC](https://forum.inductiveautomation.com/t/write-to-bit-in-word-dword-tag-browser-siemens-opc-ua-server/61869/1 "2022-07-13T19:20:33Z")

</div>

In the Tag Browser it is possible to read and write to the DWord. When I create a boolean (bit from this DWord), Same OPC Item Path wit /1 or :1, I can read the bit, but writing is not possible.

The error Message:

_Error writing to WORD\_1.value: Bad(“Bad\_TypeMismatch: The value supplied for the attribute is not of the same type as the attribute’s value.”)_

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/d/8d5f0b18180cc38c85b64fc42bfd24f5b3fb71a0.png)

Siemens CPU 1512SP-1 PN with OPC UA connection.

---

<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:** [July 13, 2022, 7:33pm UTC](https://forum.inductiveautomation.com/t/write-to-bit-in-word-dword-tag-browser-siemens-opc-ua-server/61869/2 "2022-07-13T19:33:59Z")

</div>

I’ve just tested this out here with our S7-1500 and unfortunately this syntax doesn’t do what you’re hoping.

The server in the S7-1500 is just ignoring the stuff on the end and sending back a value of the original datatype, and in Ignition you’re just coercing that to a Boolean value. Any non-zero value in the original tag will be true.

It doesn’t look like the S7-1500 server supports this kind of bit addressing syntax.

---

<div class="post-metadata">

**Author:** ![Delfien\_De\_Witte](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Delfien\_De\_Witte](https://forum.inductiveautomation.com/u/Delfien_De_Witte)\
**Post date:** [July 14, 2022, 6:29am UTC](https://forum.inductiveautomation.com/t/write-to-bit-in-word-dword-tag-browser-siemens-opc-ua-server/61869/3 "2022-07-14T06:29:31Z")

</div>

> [@Kevin.Herron](#):
>
> The server in the S7-1500 is just ignoring the stuff on the end and sending back a value of the original datatype, and in Ignition you’re just coercing that to a Boolean value. Any non-zero value in the original tag will be true.

Do you know a way to write to a bit in a word anyway with a S7-1500 server?

---

<div class="post-metadata">

**Author:** ![m.pelagatti](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/m.pelagatti/32/68595_2.png) [@m.pelagatti](https://forum.inductiveautomation.com/u/m.pelagatti)\
**Post date:** [July 14, 2022, 9:03am UTC](https://forum.inductiveautomation.com/t/write-to-bit-in-word-dword-tag-browser-siemens-opc-ua-server/61869/4 "2022-07-14T09:03:26Z")

</div>

Use derived tag boolean like this (example with bit 12 of source tag )

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/2/52c46228d962d4a6f72ac94e48168abf7fe55bf6.png)

---

<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:** [July 14, 2022, 1:00pm UTC](https://forum.inductiveautomation.com/t/write-to-bit-in-word-dword-tag-browser-siemens-opc-ua-server/61869/5 "2022-07-14T13:00:56Z")

</div>

You’d have to do something like @m.pelagatti suggested, which is a fancy way of modifying the word and writing the entire word back down. It’s subject to race conditions if the value might change in the PLC or be written to by other clients.
