Allen-Bradley LOGIX 5000 Reference Manual page 518

Controllers advanced process control and drives and equipment phase and sequence instructions
Hide thumbs Also See for LOGIX 5000:
Table of Contents

Advertisement

Chapter 10
Structured Text Programming
Use this format
value1 operator value2
stringtag1 operator stringtag2
stringtag1 operator 'character string literal'
char1 operator char2
To enter an ASCII character directly into the
expression, enter the decimal value of the
character.
bool_tag := bool_expressions
518
The table provides examples of using relational operators
Example
For this situation
If temp is a DINT tag and your specification says: 'If temp is
less than 100⋅ then...'
If bar_code and dest are string tags and your specification
says: 'If bar_code equals dest then...'
If bar_code is a string tag and your specification says: 'If
bar_code equals 'Test PASSED' then...'
If bar_code is a string tag and your specification says: 'If
bar_code.DATA[0] equals 'A' then...'
If count and length are DINT tags, done is a BOOL tag, and
your specification says: 'If count is greater than or equal to
length, you are done counting.'
How strings are evaluated
The hexadecimal values of the ASCII characters determine if one string is less than
or greater than another string.
When the two strings are sorted as in a telephone directory, the order of the
strings determines which one is greater.
Strings are equal if their characters match.
Characters are case sensitive. Upper case "A" ($41) is not equal to lower case
"a" ($61).
See also
Structured Text Components: Expressions
Rockwell Automation Publication 1756-RM006K-EN-P - November 2018
Write
IF temp<100 THEN...
IF bar_code=dest THEN...
IF bar_code='Test PASSED' THEN...
IF bar_code.DATA[0]=65 THEN...
Done := (count >= length);
on
page 513

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents