# Convert incoming modbus value as integer into float

**URL:** <https://forum.inductiveautomation.com/t/convert-incoming-modbus-value-as-integer-into-float/73859>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [May 17, 2023, 7:01pm UTC](https://forum.inductiveautomation.com/t/convert-incoming-modbus-value-as-integer-into-float/73859 "2023-05-17T19:01:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [May 17, 2023, 7:01pm UTC](https://forum.inductiveautomation.com/t/convert-incoming-modbus-value-as-integer-into-float/73859/1 "2023-05-17T19:01:12Z")

</div>

I have some modbus tags I am reading in and they are coming in as integers. This integer value I believe has to be divided by 10 to give me the actual value, for example an integer value of 212 coming in is really 21.2. I'd then like to change this integer value into a float and display this on a vision screen. So essentially I want to do the following: Int/10 = float.

I am creating a UDT for each modbus tag. The only think I can think of doing is to include a derived tag in the UDT. I would read in the value as an Int. Then the derived tag would be of type float and it would divide the Int value by 10.

Is there an easier way?

---

<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:** [May 17, 2023, 7:03pm UTC](https://forum.inductiveautomation.com/t/convert-incoming-modbus-value-as-integer-into-float/73859/2 "2023-05-17T19:03:43Z")

</div>

Tag Scaling

[https://docs.inductiveautomation.com/display/DEP/Tag+Scaling+Properties#TagScalingProperties-SimpleDividebyTen](https://docs.inductiveautomation.com/display/DEP/Tag+Scaling+Properties#TagScalingProperties-SimpleDividebyTen)

---

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [May 17, 2023, 7:31pm UTC](https://forum.inductiveautomation.com/t/convert-incoming-modbus-value-as-integer-into-float/73859/3 "2023-05-17T19:31:14Z")

</div>

Thanks. I see what you can do now with scaling. Looks like if I enable linear scaling by default it will automatically divide the incoming value by 10 so if my raw value range is -500 to 2999 in integer form my scaled range would be -50 to 299.9. Unfortunately I dont have access to the plc to try this out but I'm assuming I can't make this value an integer and I would have to have the Value coming in be a Float in order to get the one decimal place?

---

<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:** [May 17, 2023, 7:46pm UTC](https://forum.inductiveautomation.com/t/convert-incoming-modbus-value-as-integer-into-float/73859/4 "2023-05-17T19:46:03Z")

</div>

No, this scaling works fine with the PLC value being an integer type. Do make the Ignition tag a float, though.

---

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [May 17, 2023, 7:46pm UTC](https://forum.inductiveautomation.com/t/convert-incoming-modbus-value-as-integer-into-float/73859/5 "2023-05-17T19:46:40Z")

</div>

Ok thanks, thats what I figured
