7-98
SORT,DSORT
Program Example
(1) The following program sorts the BIN 16-bit data in 10 points from D0 in the ascending/
descending order when X10 is turned ON.
[Ladder Mode] [List Mode]
[Operation]
(2) The following program sorts the BIN 32-bit data in 20 points from D0 in ascending/
descending order when X10 is turned ON.
[Ladder Mode] [List Mode]
[Operation]
Step
Instruction
Device
Data before sort
Data after sort
-999
-1
12345
100
12345
-1
100
-999
-999
100
-1
12345
D1
D2
D3
D0
D1
D2
D3
D0
D1
D2
D3
D0
X0 OFF
X0 ON
Step
Instruction
Device
Data before sort
-1
-99999
-1111
5000
456789
D3, D2
D5, D4
D7, D6
D9, D8
D1, D0
Data before sort
5000
456789
-1111
1
-99999
D3, D2
D5, D4
D7, D6
D9, D8
D1, D0
-1111
-99999
5000
1
456789
D3, D2
D5, D4
D7, D6
D9, D8
D1, D0
X0 ON
X0 OFF