# Function code 16

**URL:** <https://forum.inductiveautomation.com/t/function-code-16/71517>\
**Category:** General Discussion\
**Created:** [March 23, 2023, 6:13pm UTC](https://forum.inductiveautomation.com/t/function-code-16/71517 "2023-03-23T18:13:31Z")\
**Posts on this page:** 4\
**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:** [March 23, 2023, 6:13pm UTC](https://forum.inductiveautomation.com/t/function-code-16/71517/1 "2023-03-23T18:13:31Z")

</div>

Hi guys, I got a value need to write to register 1, bit 10 with function code 16. But I always get function code 3 at the end.  
Any advise for this issue how I can get function code 16 instead of 3?

---

<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 23, 2023, 6:14pm UTC](https://forum.inductiveautomation.com/t/function-code-16/71517/2 "2023-03-23T18:14:48Z")

</div>

Assuming you're talking about Modbus here, for context.

Create a tag with an address that uses the bit syntax like this: `[DeviceName]HR1.10`

The driver will attempt to use the Mask Write Register command when writing to bits.

---

<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:** [March 23, 2023, 11:19pm UTC](https://forum.inductiveautomation.com/t/function-code-16/71517/3 "2023-03-23T23:19:24Z")

</div>

Hi Kevin, I have tried to use [Device]HR1.10 and at modbus protocol I read function code of 3 instead of 6 or 16.

---

<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 23, 2023, 11:42pm UTC](https://forum.inductiveautomation.com/t/function-code-16/71517/5 "2023-03-23T23:42:46Z")

</div>

Ok I see now. I thought you were talking about 0x16, not 16 (Write Multiple Registers).

There is an advanced setting on each device you can use to force multiple register writes. Otherwise it's only used when writing to more than 1 register.
