Allen-Bradley Logix5000 Reference Manual page 676

1756 controllogix, 1768 compactlogix, 1769 compactlogix, 1789 softlogix, 1794 flexlogix, powerflex 700s with drivelogix
Hide thumbs Also See for Logix5000:
Table of Contents

Advertisement

Appendix C
Structured Text Programming
Use this format
value1 operator value2
stringtag1 operator stringtag2
char1 operator char2
To enter an ASCII character directly into the
expression, enter the decimal value of the
character.
bool_tag := bool_expressions
How Strings Are Evaluated
676
The table shows some examples.
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.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.'
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.
L
e
s
s
e
r
• Strings are equal if their characters match.
• Characters are case sensitive. Uppercase 'A' ($41) is not equal to lowercase
'a' ($61).
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Write
IF temp<100 THEN...
IF bar_code=dest THEN...
IF bar_code.DATA[0]=65 THEN...
Done := (count >= length);
ASCII Characters
1ab
1b
G
r
A
e
AB
a
t
B
e
a
r
ab
Hex Codes
$31$61$62
$31$62
$41
$41$42
AB < B
$42
a > B
$61
$61$62

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents