IIF
The IIF function is used to test a condition and return one of two values depending on whether the condition is true or false.
Function Name |
IIF |
Description |
Tests a condition and returns one of two values depending on whether the condition is true or false. |
Arguments |
IIF(Condition, True Value, False Value) Where:
|
Returns |
Dependent on the argument. |
Example:
The following expression is used on a Mimic animation for the Style property of a button item. It uses the IIF function to determine the style of a button based on the alarm state of a point:
IIF( ".1 Bit Digital.AlarmState" = 4, 1, 0 )
If the point named ' 1 Bit Digital
' has an alarm state of 4 (indicating that the point has an unacknowledged uncleared alarm), the style is latched (1 corresponds to the Latched style of button). If the point has any other alarm state (in other words, the Alarm State does not equal 4), the style is normal ( 0 corresponds to the Normal style of button).