Chapter 6 Instruction and Flag List
XBC E-Type Main Unit
6-224
Ver. 1
6.32.18 SORT, DSORT
Instruction
Area Available
Step
Flag
P M K
F
L
T
C
S
Z D.x R.x
Con
st
U
N
D
R
Error
(F110)
Zero
(F111)
Carry
(F112)
(D)SORT
S
O O O O O O O
-
O
-
-
-
O O O O
4~7
O
-
-
N1 O O O
-
O O O
-
O
-
-
O O O O O
N2 O O O
-
O O O
-
O
-
-
O O O O O
D1 O O O
-
O
-
-
-
O
-
-
-
O O O O
D2 O O O
-
O
-
-
-
O
-
-
-
-
O O O
Operand
Description
Data Type
S
Start position of data to align
WORD/DWORD
N1
Aligning range & order (in ascending/descending order)
WORD
N2
Execution range per time (< Aligning range)
WORD
D1
Instruction completed address (1: complete, 0: in progress or in Off state)
WORD
D2
Auxiliary area
WORD
[Flag Setting]
Flag
Description
Device Number
Error
If N1’s value exceeds applicable area
If specified N1+1 aligning order is other than 0 or 1
F110
1) SORT
(1) Sorts (aligns) N1-point Binary 16-bit data from S1 in ascending(0)/descending(1) order based on
N1+1 value.
(2) Sorting by SORT instruction needs several scans. Scan times until instruction completion is the value divided
by the number of data compared with the maxiumum execution times in specified N2’s 1 time execution
(decimals will be omitted). The larger N2’s value is, the fewer number of scans and the longer scanning time
is.
(3) If N2=0, the instruction will not be executed.
(4) Maximum execution times until sorting is completed shall be operated as follows;
Maximum execution times until completion = (N1) * (N1 -1) ÷ 2 ÷ N2 [times]
For example, if N1=10 and N2=1, 10 * (10-1) ÷ 2 ÷ 1=45(times). If
N2=2, 45 ÷ 2 = 22.5 → 23 [scans] will be
taken to complete sorting.
(5) Specified D1 device (completed device) saves 1 if SORT Instruction is completed. After sorting, turn input
(D)SORT
S
N2 D1
N1
D2
means (D)SORT
Sorted in descending order
Sorted in ascending order
N1+1
35
-10
500
-124
Data before sorting
-124
-10
35
500
500
35
-10
-124
4
0
N1
N1+0
0
1
Summary of Contents for XBC-DN10E
Page 1: ......
Page 10: ...Table of Contents Table of Contents 6 10 10 CLEAR ALL PLC 29...