Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hi,
I did a subscription with a code that transcoding the HEX string to pass values to the proprieties of a thing.
So I wrote a function(javascript) in the subscription that I can call many times. This worked fine.
var result = MYFUNCTION(me.SystemStatus,me.WarningFlags); the result is like this: result = [value(BOOL), [array](BOOL) ]
//------------Binding propriety Status_RUN-------------------//
me.Status_RUN = result[0]; //BOOLEAN
//------------Binding proprieties WaringFlags-------------------//
me.Hopper_1_Backup = result[1][0]; //BOOLEAN
me.Hopper_1_Empty = result[1][4]; //BOOLEAN
me.Hopper_1_full = result[1][10]; //BOOLEAN
me.Sd_card_full = result[1][16]; //BOOLEAN
This worked fine.
FOR GREATER CONTROL, I wrote the MYFUCNTION in one service called STATE.
SERVICE:
...........
return [Status_RUN,Werror];
}
//binging
var result = MYFUNCTION(me.SystemStatus,me.WarningFlags);
SUBSCRIPTION:
I called the service:
....
var result = me.STATE();
then I bound propreties:
//------------Binding propriety Status_RUN-------------------//
me.Status_RUN = result[0]; //BOOLEAN
//------------Binding proprieties WaringFlags-------------------//
me.Hopper_1_Backup = result[1][0]; //BOOLEAN
me.Hopper_1_Empty = result[1][4]; //BOOLEAN
me.Hopper_1_full = result[1][10]; //BOOLEAN
me.Sd_card_full = result[1][16]; //BOOLEAN
Doesn't work, the values of the proprieties doesn't chage!!!
CAN YOU HELP ME???
Thanks