Topic: DMD0102 IF - If / Else Expression |
|
This instruction can only be used in the Expression parameter of the Calculate Expression (MATH) instruction.
The 3-parameter If / Else Expression (IF) math function evaluates the first parameter to determine which of the following two parameters to process. If the first parameter is non-zero (TRUE, ON) the Result will be the value of the second parameter, If the first parameter is zero (FALSE, OFF) the Result will be the value of the third parameter.
The parameter list must consist of 3 parameters separated by commas. Each of the parameters is an expression, which can be a constant value, a bit or numeric memory location, an arithmetic expression, and / or mathematical function or other expressions up to a maximum of 1024 characters. Expressions can be nested, so use of parentheses is recommended to ensure proper evaluation order.
This function has the following three parameters:
|
|
See Also:
IF - If / Else Expression
|
|
Rung Example:
|
|