You are here: Core Reference > Coding > Logic > AND, OR, and XOR

AND, OR, and XOR

You can use AND, OR and XOR for multiple conditions. These keywords provide the following results:

Input Values AND OR XOR

Input A = True

Input B = True

True

True

False

Input A = True

Input B = False

False

True

True

Input A = False

Input B = True

False

True

True

Input A = False

Input B = False

False

False

False

The syntax for entering an AND, OR or XOR keyword is:

where <value-name> is the name of the variable that will store the result of the statement, <Value1> is the first input value, <Value2> is the second input value, and Keyword is AND, OR or XOR as required.

Example:

  • Output := Input1 AND Input2;

This sets the value of the variable named Output to be True if Input1 and Input 2 are both True, or False if only one of the inputs is True.

  • Output := Input1 OR Input2;

This sets the value of the variable named Output to be True if either Input1 or Input 2 are True. The Output value will only be False if both of the inputs are False.

  • Output := Input1 XOR Input2;

This sets the value of the variable named Output to be True if one of the inputs is True and the other is False. The Output will be False if both of the inputs are True or if both of the inputs are False.


ClearSCADA 2015 R2