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

AND

a AND b

Logical AND (also written &)

OR

a OR b

Logical OR

XOR

a XOR b

Logical exclusive OR

NOT

NOT a

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