If('Condition','Expression1','Expression2')

Arguments

'Condition'

Condition as an operation with the Boolean results, TRUE or FALSE

'Expression1'

Operation is performed if 'Condition' is TRUE

'Expression2'

Operation is performed if 'Condition' is FALSE

Description

The If-function can be used for a conditioned execution of further calculations. Depending on the Boolean result of a 'Condition’, which can itself be an operation, the operation ‘Expression1’ will be executed if the result is TRUE and the operation ‘Expression2’ if the result is FALSE.

In conclusion, different process-controlled calculations can be performed. You can use this function of course in an interlaced form to realize further branches. Text signals are supported.

Example

Detecting when a measurement signal is over a set limit

Solution

The limit is formulated in 'Condition' as a condition with logical operands. If 'Condition' is TRUE, the value of 4 is returned, if FALSE then the value of 1.

In the figure below the condition is met above the dotted line (marked in green). Below the dotted line the condition is not met.