Multiple Comparisons

Often, you will want to check more than just one tag.  For example, if a tank level is above 90% AND the safety valve is closed, then open the valve.  (If the valve is already open, there's no point opening it, and if the tank level is below 90% you also don't want to open the safety valve.)

You can join as many comparisons as you want together with the symbols && (which means "AND") and || (which means "OR").  Don't forget that you can use parenthesis to make it clear which value is being compared to which.

The following example will return true only when both the level in Tank 1 and the level in Tank 2 exceed 80%

Variable("TankLevel_1")\value > 80 && Variable("TankLevel_2")\value > 80

The next example returns true whenever either tank exceeds 80%

Variable("TankLevel_1")\value > 80 || Variable("TankLevel_2")\value > 80