Convert incoming modbus value as integer into float

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?

Tag Scaling

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

3 Likes

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?

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

1 Like

Ok thanks, thats what I figured