Mitsubishi Electric MELSEC-Q/L Programming Manual page 199

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

• If the character strings are different, the first different sized character code will determine whether the character string is larger or smaller.
b15
b8
b7
b0
(S1)
32H
(2)
31H
(1)
(S1)+1
34H
(4)
33H
(3)
(S1)+2
00H
35H
(5)
"12345"
Instruction symbol
$=
$<>
$>
• If the character strings designated by (S1) and (S2) are of different lengths, the data with the longer character string will be larger.
b15
b8
b7
b0
(S1)
32H
(2)
31H
(1)
(S1)+1
34H
(4)
33H
(3)
(S1)+2
36H
(6)
35H
(5)
(S1)+3
00H
37H
(7)
"1234567"
Instruction symbol
$=
$<>
$>
Operation error
• In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
Error
Error details
code
4101
The NULL code "00H" does not exist within the range of the corresponding
devices, starting from the device specified by (S1) and (S2).
The number of character strings of (S1) and (S2) exceeds 16383.
The character string data comparison instruction checks the device range while comparing the designated
character string data.
For this reason, even though the NULL code "00H" does not exist within the range of the corresponding
devices, the instruction outputs a comparison result instead of returning an operation error when no match of
characters is detected.
Example
$
Data of
D12287
W0
If (S1) and (S2) data are as shown above, the second character of (S1) does not match with that of (S2), and
the comparison result is expressed as (S1)(S2) (the operation result is "non-conductive").
Though the NULL code "00H" is not included within the (S1) device range, no operation error is returned,
because mismatch is detected at D12287, which is within the device range.
b15
b8
b7
(S2)
32H
(2)
31H
(S2)+1
33H
(3)
34H
(S2)+2
00H
35H
"12435"
Comparison operation result
Non-continuity
Continuity
Non-continuity
b15
b8 b7
(S2)
32H
(2)
31H
(S2)+1
34H
(4)
33H
(S2)+2
36H
(6)
35H
(S2)+3
00H
00H
"123456"
Comparison operation result
Non-continuity
Continuity
Continuity
D12287
D10
S1
S2
S1
B
A
00
C
H
b0
(1)
(4)
(5)
Instruction symbol
$<=
$<
$>=
b0
(1)
(3)
(5)
Instruction symbol
$<=
$<
$>=
Q00J/
QnH
QnPH
Q00/
Q01
M0
Data of
S2
D10
Z
A
D11
00
C
H
6.1 Comparison Operation Instructions
Comparison operation result
Continuity
Continuity
Non-continuity
Comparison operation result
Non-continuity
Non-continuity
Continuity
QnPRH
QnU
LCPU
6 BASIC INSTRUCTIONS
197
6

Advertisement

Table of Contents
loading

Table of Contents