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:

  • Condition is a Boolean expression that defines the condition that is to be tested
  • True Value is an expression that is returned if the condition is true
  • False Value is an expression that is returned if the condition is false.
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).


Disclaimer

ClearSCADA 2017 R3