Attention
IronPLC supports IEC 61131-3 Structured Text excluding I/O mapping.
Logical Operators¶
Logical operators perform boolean logic on BOOL operands.
IEC 61131-3 |
Section 3.3.1 |
Support |
Supported |
Syntax¶
Operator |
Syntax |
Description |
|---|---|---|
|
|
Logical AND (also written |
|
|
Logical OR |
|
|
Logical exclusive OR |
|
|
Logical complement (unary) |
Description¶
AND (or &) returns TRUE only when both operands are TRUE.
OR returns TRUE when at least one operand is TRUE. XOR returns
TRUE when exactly one operand is TRUE. NOT inverts a single
boolean value.
Precedence from highest to lowest: NOT, AND / &, XOR, OR.
Use parentheses to override the default precedence.
Example¶
See Also¶
BOOL — boolean data type
Comparison Operators — relational operators producing BOOL
Arithmetic Operators — numeric operators