Basic Instructions
2 − 137
Explanation of example
Compares the contents of data register DT0 with the constant K50 and K60. If DT0 = K50, the external output
relay Y30 goes on and if DT0
K60, the external output relay Y31 turns on.
60
50
10
Y30
Y31
DT0
on
off
on
off
Description
Compares the word data specified by S1 with the word data specified by S2 according to the comparison
condition.
The ST instruction initiates a logical operation as the liaison contact when the comparison result is a specified
status (=, <, >, etc.).
The result of the comparison operation is as follows:
Comparison
Condition
instruction
S1 < S2 S1 = S2 S1 > S2
ST= off on off
ST <> on off on
ST> off off on
ST>= off on on
ST< on off off
ST<= on on off
Precautions concerning usage
The start comparison instructions ST =, ST<>, ST >, ST >=, ST <, and ST <= are programmed from the bus
line.
If mixed with BCD or other type of data, the value will be regarded as negative when the most significant bit is 1
and a correct comparison may not be obtained. In this case, use an F81 (BIN) instruction or similar instruction
to change the data to binary data before making the comparison.
Flag conditions
・Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
・Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
< > indicates
>= indicates
<= indicates