Question:
In my application, there are two PLC tags indicating the status of a circuit breaker (double point). How can I set them so a figure shows a certain color according to the combination of these two tags?
Example:
A B
0 0 – Undetermined – Yellow
0 1 – Open – Green
1 0 – Closed – Red
1 1 – Undetermined – Yellow
Solution:
To do so, you can create a table link in the figure’s ForegroundColor property with the following formula: tagA * 2 + tagB * 1
This will generate the following combination:
0 0 -> 0
0 1 -> 1
1 0 -> 2
1 1 -> 3
When setting the table link, be sure to configure it to display yellow when the value is either 0 or 3, green when it is 1, and red when it is 2.