What is the most efficient method to combine multiple bool status tags into a single tag to drive a perspective motor SVG state change?
For example, I have a Motor with a separate Fault Tag, Run Tag, and Stopped Tag that all needs to drive the state change on the motor svg symbol in perspective.
Use the binEnc
expression function.
e.g.
binEnc({stopped}, {running}, {faulted})
This will produce a binary encoded value which you can decipher in a case statement:
case(binEnc({stopped}, {running}, {faulted})
,1, 'Stopped'
,2, 'Running'
,4, 'Faulted'
,5, 'Faulted'
,6, 'Faulted'
, 'Invalid'
)
3 Likes