Change Display Value

Paolo Scarpetta 5 jaar geleden in Server Solutions / Windows Server bijgewerkt door Oksana (expert) 5 jaar geleden 3

I got a termostat that give the variable value like (ex. 243) instead of 24,3, so when I try to display this value with $VºC It shows "243 ºC" instead 24,3 ºC, How can I fix this?

I use a Iridium Server with Iridium client.




This is one way you can do it:

1. Create a new feedback in the server for the adjusted value, synch to the client. you can add this feedback tothe driver, or create a server tag. In the example below I have assume the new feedback is added to the driver

2. In JS Add subscription to the Tag of the variable and correct the value.

3. set the new feedback to that value

4. In the client, use the new feedback in the gui

//Set global listener
IR.SetGlobalListener(IR.EVENT_GLOBAL_TAG_CHANGE, function(name, value)
     IR.Log("Global Listener Activated: " + name + "\tValue: " + value);
     if (name == "MyDriverName.MyThermostatFeedbackName"){                                                          
        //update adjusted feedback
        var newValue = value * 0.1; 
          IR.SetVariable("MyDriverName.Temperature_Adjusted", newValue);