3 . I n s t r u c t i o n S e t
M N050 03003E F or mo re infor ma tio n vi sit:
w w w. e a t o n . c o m
3-197
API Mnemonic
Operands
Function
69
SORT
S,
m
1
, m
2
, D, n
Data sort
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C D E
F
S
*
m
1
*
*
m
2
*
*
D
*
n
*
*
*
SORT: 11 steps
DSORT: 21 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P 32 16 P 32 16
P
Operands:
S
: Starting address of source data
m
1
: The number of sort data groups (
m
1
=1~32)
m
2
: The
number of columns for the data (
m
2
=1~6)
D
: Starting address for storing the sort data
n
: Present
column of the sort data matrix (
n
=1~
m2
)
Description:
1.
The sorted data is stored in the
m
1
×
m
2
table of registers beginning with
D
. If devices
S
and
D
specify the same register, the resulting sorted data will be the same as the contents of source
device
S
.
2.
Once the SORT instruction has completed, the Flag M1029 (Execution complete flag) = ON.
3.
There is no limit to the number of times this instruction may be used in the program. However,
only one instruction can be executed at a time
Program Example:
1.
When X0 = ON, it starts to sort the specified data. After the data sort is complete, M1029= ON.
During the execution of the SORT instruction, data being sorted should not be changed. If the
sort data needs to be changed the SORT instruction should be turned OFF, modify the data,
then turn SORT instruction back on.
X0
SORT
D0
K5
K5
D50
D100
2.
The tables below show how the matrix is established and how the data is sorted in numerical
order in the selected column, based on the column number specified in D100. The first sort
table below using D0-D24 must be entered by the user. When a number from 1-5 for this
example is written to D100, that column will be sorted numerically in the matrix formed by
D50-D74. All data will be moved properly to the output matrix (D50-D74), but only the data in
the selected column will be sorted into numerical order. All other data in the destination matrix
will be placed in the proper position based on the data order in the selected column.
Содержание ELC-PB
Страница 1: ......
Страница 5: ...For more information visit www eaton com MN05003003E iv...
Страница 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Страница 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Страница 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Страница 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...