Mitsubishi MELSEC-Q/L Programming Manual page 379

Table of Contents

Advertisement

Operation Error
(1) 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
code
4100
is 0 or a negative value.
S2
The range from S1 to (S1 + n/2
4101
from D2 to D2 +1.
For the SORT(P) instruction, the range of the device specified by
4101
exceeds the range from S1 to S1 + n (including S1).
For the DSORT(P) instruction, the range of the device specified by
4101
exceeds the range from S1 to S1 + (2
Program Example
(1) The following program sorts the BIN 16-bit data from D0 to D3 in the ascending/descending order when X10 is turned
ON.
[Ladder Mode]
[Operation]
Data before sort
X0
D0
100
D1
-1
D2
12345
-999
D3
X0
(2) The following program sorts the BIN 32-bit data from D0 to D9 in ascending/descending order when X10 is turned ON.
[Ladder Mode]
Error details
n) (including S1) overlaps the range
n) (including S1).
[List Mode]
Step
Data after sort
D0
-999
D1
-1
OFF
100
D2
12345
D3
D0
12345
D1
100
ON
-1
D2
-999
D3
[List Mode]
Step
Q00J/
Q00/
QnH
QnPH QnPRH
Q01
S1
S1
Instruction
Device
Instruction
Device
SORT, DSORT
QnU
LCPU
377
1
2
3
4
4
6
7
8

Advertisement

Table of Contents
loading

Table of Contents