I’ve got an actuated valve that has a tag for open and a tag for closed. If it is closed and you push the button for open, both tags for open and closed are = 1 until limit switch is hit, changing the closed tag value to 0.
I am trying to make an expression where a multistate will be red when closed tag =1 and green when opened tag = 1, and flash green/red and display “operating” when both tags = 1. Is it possible to do this?
Yes. A simple label can do this with a few expressions. First, bind its ‘text’ property to an expression like:if({[Client]Opened} && {[Client]Closed}, "Operating", "")That’ll make the text only appear when both bits are true. Then create a custom property “Blink” and bind it to an expression like:dateExtract(now(250), 'second') % 2That’ll make it toggle every second. Finally, set the “Fill Background” property, and bind the background color to another expression, like:if({[Client]Opened},
if({[Client]Closed},
if({Root Container.Label.Blink}, "red", "green"),
"green"),
if({[Client]Closed}, "red", "orange"))Note the “orange” at the end. That allows an operator to see a device failure that leaves both signals off.