# Handling Modbus Unsigned DINTs (UDINT)

**URL:** <https://forum.inductiveautomation.com/t/handling-modbus-unsigned-dints-udint/81341>\
**Category:** Ignition\
**Created:** [November 2, 2023, 2:04am UTC](https://forum.inductiveautomation.com/t/handling-modbus-unsigned-dints-udint/81341 "2023-11-02T02:04:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_Oostendorp](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Sam\_Oostendorp](https://forum.inductiveautomation.com/u/Sam_Oostendorp)\
**Post date:** [November 2, 2023, 2:04am UTC](https://forum.inductiveautomation.com/t/handling-modbus-unsigned-dints-udint/81341/1 "2023-11-02T02:04:17Z")

</div>

I am trying to write to a modbus tag of type UDINT from Ignition. For example this tag is in HR1714-HR1715 (MW1714, unsigned DINT). Because this is of type _unsigned_ but ignition integers are _signed_ it is writing to the wrong integer within the UDINT. For example I write 5000 (1001110001000) and the PLC is receiving 327680000 (10011100010000000000000000000).

I realize I could instead just give it an OPC item path of HR1715 instead of HR1714 but then I feel I would lose half the bits in the DINT should I ever need it. Additionally, I have hundreds of these so mapping these would be a nightmare.

Am I going about this wrong, or is there a better way to handle the signed/unsigned issue? I would prefer to avoid writing an expression to every one of these tags to do a byte swap if possible.

---

<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:** [November 2, 2023, 2:13am UTC](https://forum.inductiveautomation.com/t/handling-modbus-unsigned-dints-udint/81341/2 "2023-11-02T02:13:24Z")

</div>

Address the tag as `HRUI1714`.

See [Modbus Addressing - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Modbus+Addressing) for more information.

---

<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:** [November 2, 2023, 11:42am UTC](https://forum.inductiveautomation.com/t/handling-modbus-unsigned-dints-udint/81341/3 "2023-11-02T11:42:58Z")

</div>

You probably also need to use word swapping (or, perhaps, zero-based addressing). Look in the device advanced settings.

---

<div class="post-metadata">

**Author:** ![Sam\_Oostendorp](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Sam\_Oostendorp](https://forum.inductiveautomation.com/u/Sam_Oostendorp)\
**Post date:** [November 2, 2023, 12:15pm UTC](https://forum.inductiveautomation.com/t/handling-modbus-unsigned-dints-udint/81341/4 "2023-11-02T12:15:26Z")

</div>

Thank you for the quick response, the word swapping was it. I was wondering if I would ever be blessed to get an answer from the great pturmel.
