# Modbus dual UINT16 to Float

**URL:** <https://forum.inductiveautomation.com/t/modbus-dual-uint16-to-float/28936>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [October 8, 2019, 8:44pm UTC](https://forum.inductiveautomation.com/t/modbus-dual-uint16-to-float/28936 "2019-10-08T20:44:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rusty](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rusty/32/19859_2.png) [@Rusty](https://forum.inductiveautomation.com/u/Rusty)\
**Post date:** [October 8, 2019, 8:44pm UTC](https://forum.inductiveautomation.com/t/modbus-dual-uint16-to-float/28936/1 "2019-10-08T20:44:46Z")

</div>

Hello,

I am communicating with a Modbus TCP device. I’ve followed the instructions here: [http://www.intricatescada.com/main/system/help/About\_Modbus\_Address\_Mapping.html](http://www.intricatescada.com/main/system/help/About_Modbus_Address_Mapping.html) and completed the address mapping.

I am trying to get float values by using the step function in the address configuration from 2 UINT16s. The " Holding Register (Float)" function however seems to use 2 INT16s instead of UINT16s.

It seems the system cannot convert dual UINTs to floats but instead only dual INTs to floats. I would need to convert the numbers from UINTs to INTs and then use the step function to convert groups of two INTs to a float. Basically I need to convert the data type twice, how can I do that?

Thanks

---

<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:** [October 8, 2019, 8:58pm UTC](https://forum.inductiveautomation.com/t/modbus-dual-uint16-to-float/28936/2 "2019-10-08T20:58:49Z")

</div>

The driver does not turn these registers into separate Int16 or UInt16s before making them a Float, so there is no difference.

If e.g. you read HRF1, then the driver requests 2 registers starting from address 1, gets 4 bytes in return, and then creates a Float value from those 4 bytes.

If you’re not seeing the result you expect maybe you need to try the Swap Word Order setting?

---

<div class="post-metadata">

**Author:** ![Rusty](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rusty/32/19859_2.png) [@Rusty](https://forum.inductiveautomation.com/u/Rusty)\
**Post date:** [October 9, 2019, 12:32pm UTC](https://forum.inductiveautomation.com/t/modbus-dual-uint16-to-float/28936/3 "2019-10-09T12:32:59Z")

</div>

Hi Kevin,

That makes sense that its using the byte values and not the data type formats, your’re absolutely right, I had the word order reversed after all.

Thanks for your help!
