Справочник Пользователя для Mitsubishi Electronics MELSEC -Q/L

Скачать
Страница из 1086
444
7  APPLICATION INSTRUCTIONS
7.5  Data Processing Instructions
BIN 16-bit data sort operations, BIN 32-bit data sort operations
SORT, DSORT
Processing details
SORT
 • Sorts (rearranges data) BIN 16-bit data n points from (S1) in ascending or descending order. Sort order is designated by the 
ON/OFF status of SM703:
 • Several scans are required for sorts performed by the SORT instruction. The number of scans executed until completion is 
the value obtained by dividing the maximum number of times executed until the completion of the sort by the number of 
data blocks compared at one execution designated by (S2). (Decimal fractions are rounded up.) When the value of (S2) is 
increased, the number of scans until completion of the sort is reduced, but the amount of time per scan is lengthened.
(S1):  Head device number in the table to be sorted (BIN 16/32 bits)
n:  
Number of data blocks to be sorted (BIN 16 bits)
(S2):  Number of data blocks to be compared in one sort operation (BIN 16 bits)
(D1):  Number of the bit device to be turned ON at the completion of the sort operation (bits)
(D2):  Device reserved for the system (BIN 16 bits)
Setting 
data
Internal device
R, ZR
J\
U\G
Zn
Constant
K, H
Others
Bit
Word
Bit
Word
(S1)
n
(S2)
(D1)
 (Other than T, ST, C)
(D2)
• When SM703 is OFF: Ascending order sort
• When SM703 is ON: Descending order sort
Basic
Process
High
performance
Redundant Universal
LCPU
Command
n
SORT, DSORT
S1
S2
D2
D1
indicates an instruction symbol of SORT/DSORT.
Data before sort
-124
-10
500
35
When SM703 = OFF
When SM703 = ON
 -124
35
  -10
500
500
  -10
35
 -124
Sort in the ascending order
Sort in the descending order
S
S
S
S
S
S
S
S
S
S
S
S
+1
+2
+3
+1
+2
+3
+1
+2
+3