521
FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
19 Data Operation 2 – FNC140 to FNC149
19.7 FNC149 – SORT2 / Sort Tabulated Data 2
11
FN
C30-
FN
C39
R
o
ta
tion and
Sh
ift
12
FNC
4
0
-FNC49
D
a
ta
Op
e
ra
tio
n
13
FNC5
0
-FNC5
9
H
igh Speed
Pr
ocessi
ng
14
FM
C6
0
-F
NC6
9
H
and
y
In
st
ru
cti
o
n
15
FNC7
0
-FNC7
9
Ex
te
rn
a
l F
X
I
/O
D
evi
ce
16
FNC8
0
-FNC8
9
Ext
e
rnal
FX
D
evi
ce
17
F
N
C1
00
-F
NC
10
9
Da
ta
Tr
ansf
e
r 2
18
FN
C
110-FN
C
13
9
Fl
oat
ing P
o
in
t
19
FN
C
140-FN
C
149
Da
ta
O
per
at
io
n
2
20
FN
C
15
0-F
N
C
159
P
o
si
tioni
ng
C
ont
ro
l
19.7
FNC149 – SORT2 / Sort Tabulated Data 2
Outline
This instruction sorts a data table consisting of data (lines) and group data (columns) based on a specified
group data (column) in units of line in the ascending or descending order. This instruction stores the data
(lines) in serial devices for facilitating the addition of data (lines).
On the other hand, the SORT (FNC 69) instruction stores the group data (columns) in serial devices, and
sorts a table in only the descending order.
→
For SORT (FNC 69) instruction, refer to Section 14.10.
1. Instruction format
2. Set data
3. Applicable devices
Explanation of function and operation
1. 16-bit operation (SORT2)
In the data table (sorting source) having (m1 x m2) points from
, data lines are sorted in the ascending
or descending order based on the group data in the column No. "n", and the result is stored in the data table
(sorting result) having (m1 x m2) points from
.
→
For operation examples, refer to Page 523.
Operand type
Description
Data type
Head device number storing the data table [which occupies m1
×
m2 points]
16- or 32-bit binary
m1
Number of data (lines) [1 to 32]
m2
Number of group data (columns) [1 to 6]
Head device number storing the operation result [which occupies m1
×
m2 points]
n
Column number of group data (column) used as the basis of sorting [1 to m2]
Oper-
and
Type
Bit Devices
Word Devices
Others
System User
Digit Specification
System User
Special
Unit
Index
Con-
stant
Real
Number
Charac-
ter String
Pointer
X Y M T C S D
.b KnX KnY KnM KnS
T
C
D
R U
\G
V
Z Modify K
H
E
"
"
P
3 3
m1
3 3
3 3
m2
3 3
3 3
n
3 3
3 3
FNC 149
SORT2
D
Mnemonic
Operation Condition
16-bit Instruction
11 steps
SORT
Mnemonic
Operation Condition
Continuous
Operation
32-bit Instruction
21 steps
DSORT2
Continuous
Operation
S
D
S
D
S
D
Command
input
FNC149
SORT2
m1
m2
S
n
D
M8029
M
{{
Instruction execution complete
flag for SORT2 instruction
Instruction execution complete flag