...
Code Block |
---|
|
function Encode(fPort, obj)
{
var encoded = [];
if ("Valve_Position_RCI_10_minutes" in obj)
{
var new_vp_10min = obj.Valve_Position_RCI_10_minutes;
encoded = [new_vp_10min,0x00,0x26,0x00,0x00,0x00];
}
if ("Valve_Position_RCI_5_minutes" in obj)
{
var new_vp_5min = obj.Valve_Position_RCI_5_minutes;
encoded = [new_vp_5min,0x00,0x26,0x10,0x00,0x00];
}
if ("Set_Point_Ambient_Temperature_RCI_10_Minutes" in obj)
{
var new_spt_10min = (obj.Set_Point_Ambient_Temperature_RCI_10_Minutes)*2;
encoded = [new_spt_10min,0x00,0x26,0x08,0x00,0x00];
}
if ("Set_Point_Ambient_Temperature_RCI_5_Minutes" in obj)
{
var new_spt_5min = (obj.Set_Point_Ambient_Temperature_RCI_5_Minutes)*2;
encoded = [new_spt_5min,0x00,0x26,0x18,0x00,0x00];
}
return encoded;
} |
Downlink example
Code Block |
---|
|
{"Set_Point_Ambient_Temperature_RCI_10_Minutes":22}
{"Set_Point_Ambient_Temperature_RCI_5_Minutes":20}
{"Valve_Position_RCI_10_minutes":73}
{"Valve_Position_RCI_5_minutes":42} |
Image ModifiedImage ModifiedImage Modified