Omron SYSMAC CJ - REFERENCE MANUAL 01-2008 Reference Manual page 1293

Sysmac cs/cj/one nsj series programmable controllers
Table of Contents

Advertisement

Text String Processing Instructions
Flags
Precautions
Example
1254
ADC (41444300 hex) and B (4200 hex):
ADC < B, because at the beginning of the text strings 41 (hex) is less than 42
(hex).
ABC (41424300 hex) and ABD (41424400 hex):
ABC < ABD, because at the beginning of the text strings the 41s and 42s
match, so the result is determined by 43 being less than 44.
ABC (41424300 hex) and AB (414200 hex):
ABC > AB, because at the beginning of the text strings the 41s and 42s
match, so the result is determined by 43 being greater than 00.
AB (414200 hex) and AB (414200 hex):
AB = AB, because the 41s, the 42s, and the 00s all match.
Continue programming one instruction after another, treating LD, AND, and
OR in the same way. LD and OR instructions can be connected directly to the
bus bar, but AND instructions cannot.
Name
Error Flag
ER
Greater Than
>
Flag
Greater Than or
>=
Equals Flag
Equals Flag
=
Not Equal Flag
<>
Less Than Flag
<
Less Than or
<=
Equals Flag
Note String comparison instructions are used to rearrange the order of text strings
in order of ASCII. For example, the ASCII order from lower to higher is the
order of the alphabet from A to Z, so text strings can be arranged in alphabet-
ical order.
Please a right-hand instruction after these instructions. The String Compari-
son Instructions cannot appear on the right side of the ladder diagram.
These instructions cannot be used on the last rung of a logic block.
The maximum number of characters that can be compared is 4,095 (0FFF
hex). If that number is exceeded (i.e., if there is no NUL before the 4,096th
character), an error will occur and the Error Flag will turn ON. When this hap-
pens, an OFF execution condition will be output to the next instruction.
In this example, string comparison instructions are used to compare data.
Label
ON if more than 4,095 characters are designated by S1
or S2.
OFF in all other cases.
ON if the comparison results in S1 greater than S2.
OFF in all other cases.
ON if the comparison results in S1 greater than or equal
to S2.
OFF in all other cases.
ON if the comparison results in S1 equal to S2.
OFF in all other cases.
ON if the comparison results in S1 not equal to S2.
OFF in all other cases.
ON if the comparison results in S1 less than S2.
OFF in all other cases.
ON if the comparison results in S1 less than or equal to
S2.
OFF in all other cases.
Section 3-33
Operation

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents