# Bit-Level Addressing Function Code

**URL:** <https://forum.inductiveautomation.com/t/bit-level-addressing-function-code/72407>\
**Category:** Ignition\
**Created:** [April 13, 2023, 2:06pm UTC](https://forum.inductiveautomation.com/t/bit-level-addressing-function-code/72407 "2023-04-13T14:06:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lau\_Kar\_Hei](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@Lau\_Kar\_Hei](https://forum.inductiveautomation.com/u/Lau_Kar_Hei)\
**Post date:** [April 13, 2023, 2:06pm UTC](https://forum.inductiveautomation.com/t/bit-level-addressing-function-code/72407/1 "2023-04-13T14:06:26Z")

</div>

Hi guys, currently I facing a problem with the Function Code.

My device address is [SIG]HR1.10 and when I write a boolean "True" it will give me Function Code 22.  
When I changed my device address to [SIG]HR1 and it will give me Function Code 06 or 16 depends on the device I have force or unforce the multiple write option but the input is not write on the number 10-bit.

As I saw in manual, when I use Bit-Level Addressing, it will auto do Mask Write which is Function Code 22.

My question is do I have method to use [SIG]HR1.10 (Bit-Level Addressing) to achieve Function Code 06 or 16?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/e/7e6609d21963d93550c876d3271c6fd7549db07d.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:** [April 13, 2023, 2:32pm UTC](https://forum.inductiveautomation.com/t/bit-level-addressing-function-code/72407/2 "2023-04-13T14:32:14Z")

</div>

Function codes 6 and 16 write one or more whole registers. Function code 22 can manipulate one or more individual bits. Only function code 22 can do that.

What do you really need to happen?

---

<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:** [April 13, 2023, 2:43pm UTC](https://forum.inductiveautomation.com/t/bit-level-addressing-function-code/72407/3 "2023-04-13T14:43:52Z")

</div>

If it's because your device doesn't support Mask Write Register, you can use the workaround described [here](https://forum.inductiveautomation.com/t/troubles-making-a-derived-boolean-tag-work-as-a-mask-for-a-short-tag/15203/2).

It basically forces the masking to happen at a higher level, and then a whole register to be written, with the drawback that it's prone to a race condition where the register can change underneath you causing bits to be clobbered.

---

<div class="post-metadata">

**Author:** ![Lau\_Kar\_Hei](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@Lau\_Kar\_Hei](https://forum.inductiveautomation.com/u/Lau_Kar_Hei)\
**Post date:** [April 13, 2023, 3:24pm UTC](https://forum.inductiveautomation.com/t/bit-level-addressing-function-code/72407/4 "2023-04-13T15:24:38Z")

</div>

Actually the situation is:  
Tag A = Memory Tag (Boolean)  
Tag B = [SIG]HR1.10 (Boolean)

The Tag A value will write to Tag B when Tag Change. I will get Function Code 22.

Is there any method to get Function Code 06 or 16 if I want to manipulating the bit?

---

<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:** [April 13, 2023, 3:29pm UTC](https://forum.inductiveautomation.com/t/bit-level-addressing-function-code/72407/5 "2023-04-13T15:29:43Z")

</div>

> [@Lau\_Kar\_Hei](#):
>
> Is there any method to get Function Code 06 or 16 if I want to manipulating the bit?

Only what I suggested above.

---

<div class="post-metadata">

**Author:** ![Lau\_Kar\_Hei](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@Lau\_Kar\_Hei](https://forum.inductiveautomation.com/u/Lau_Kar_Hei)\
**Post date:** [April 13, 2023, 3:48pm UTC](https://forum.inductiveautomation.com/t/bit-level-addressing-function-code/72407/6 "2023-04-13T15:48:48Z")

</div>

Am I allow to write without mask for manipulating the bit?

---

<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 13, 2023, 4:20pm UTC](https://forum.inductiveautomation.com/t/bit-level-addressing-function-code/72407/7 "2023-04-13T16:20:20Z")

</div>

No, without the mask function code, the actual write is for the whole register. If you follow the linked topic, it shows how to read the register, do the mask in Ignition, and then write the register.

(I'm going out on a limb--you probably have a Schneider PLC. In spite of being the commercial heirs to the creators of the Modbus protocol, they have the worst implementation. Specifically, lacking function 22.)
