Rockwell Automation Logix5000 Controllers Structured Text Programming Manual User Manual
Page 14

14
Publication 1756-PM007D-EN-P - November 2012
Chapter 1 Program Structured Text
In structured text, you use two types of expressions:
BOOL expression: An expression that produces either the BOOL value of 1
(true) or 0 (false).
•
A bool expression uses bool tags, relational operators, and logical
operators to compare values or check if conditions are true or false.
For example, tag1>65.
•
A simple bool expression can be a single BOOL tag.
•
Typically, you use bool expressions to condition the execution of other
logic.
Numeric expression: An expression that calculates an integer or
floating-point value.
•
A numeric expression uses arithmetic operators, arithmetic functions,
and bitwise operators. For example, tag1+5.
•
Often, you nest a numeric expression within a bool expression. For
example, (tag1+5)>65.
Use the following table to choose operators for your expressions:
If you want to
Then
Calculate an arithmetic value
Use Arithmetic Operators and Functions on page 15.
Compare two values or strings
Use Relational Operators on page 16.
Check if conditions are true or false
Use Logical Operators on page 18.
Compare the bits within values