6 - 10 6 - 10
MELSEC-Q/QnA
6 BASIC INSTRUCTIONS
[Operation Errors]
(1) In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
code is stored at SD0.
• The code “00H” or non-matching does not exist within the relevant device range following the
device number designated by
S1
or
S2
. (Error code: 4101)
POINT
At the same time that it is conducting a character string comparison, character string data
comparison instruction also checks the device range.
For this reason, even in cases where the character string exceeds the device range, the
character string data is compared. If character non-matching is detected within the device
range at this time, the comparison operation results are output without returning an operation
error.
M0
D10D12287$
"B" "A"
D12287
"C"
00H
"Z" "A"
D11
"C"
00H
W0
D10
Example
S2
S1
data
S1
data
S2
In the example shown above, the
S1
character string exceeds the device range, but because
its second character is different from that of
S2
, the comparison result is "
S1
does not equal
S2
", and the operation result is non-continuity.
In this case, because the non-continuity detection is for D12287 (inside the device range),
there will be no operation error returned.
[Program Example]
(1) The following program compares character strings stored following D0 and characters
following D10.
[Ladder Mode] [List Mode]
Steps Instruction
Device
(2) The following program compares the character string "ABCDEF" with the character string
stored following D10.
[Ladder Mode] [List Mode]
Steps Instruction
Device
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com