Afternoon Everyone,
I'm having some difficulty understanding how to turn a two button toggle off whenever a tag value is greater than or equal to a set point value. I have the button working normally and I have the tag value reading, but I can't seem figure out where to put a binding to change the component value. Does it need to be on the buttons control binding? Are there any examples of something like this out there? I have not been able to find what I am looking for.
To my understanding, you must bind the desired tag to BOTH the 'Control Value' and 'Indicator Value' properties under the 'Data' header in the toggle button. In each property, use an expression binding that reads similar to the following:
if({[~]Tag/Path/Here} >= 123, 0, 1)
Here the if-statement will set the Control and Indicator values to '0' (turn the toggle off) if your tag value is greater than the desired set point (123), and will otherwise set the values to '1' (turn the toggle on).
I usually just bind the indicator value to the control value.
2 Likes
Simple and elegant, haha. Definitely going to start doing this so I don't have to remember to copy the expression over every time I change it.
1 Like
Thanks for the replies, going to attempt this, let you know.