Modbus Data Scaling

How to scale incoming values, for or example:
Value 236 degrees, should be shown on screen as 23,6 degrees.
So de value has to be divided by 10, or a function that can shift the decimal point to the left
 
You can do it with help of Script in GUI Editor
http://wiki2.iridiummobile.ru/?title=IRidium_Driver_SDK
http://wiki2.iridiummobile.ru/?title=Drivers_API

Create a new script, initializes devices and make a function for division. The function for division is:

IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetDevice("Modbus TCP"), function(name,value){   
   if(name == "nameOFchannel") {
        IR.GetItem("Page 1").GetItem("Item 1").Text = (value*0.1).toFixed(1).toString();    
   }
});

All the sample and script is in the attachment (it will work with Modbus controller or simulation tool)
 
MathExample.irpz

Is this article helpful for you?