Expression Tag defaulting to fallback

Hello everyone,

I made an expression tag that checks the values from an OPC array tag. Depending on which element of the array is active (bool values), the expression tag will return a defined string with the output/error name.

The thing is that every time an array element is active, the expression tag returns the fallback value instead of the respective case. I tried a polling rate of 500 ms, with my tag group and event driven but the same continues to happen: every time any one of the array elements change, the tag will get the default value for the switch function but with the newest time stamp.

Is there something in the expression I can’t see or doing wrong?

Thanks in advance

I forgot to mention that 90% of the times, only 1 array element will be fired at a time; it is highly unlikely for 2 or more to change state at the same time or for the same “clock cycle”

I’d start by putting the bincEnc in s separate expression so that you can see the value.

I saw what I did wrong in my original code. I was using as path Bool_array**.value**[n]

do you have any idea on what I could do to retain the last value of the encoder output/switch return? maybe a delayed timer on the fallback, or should I create a function and use the runScript command?