Mitsubishi MELSEC-Q/L Programming Manual page 378

Table of Contents

Advertisement

SORT, DSORT
(5) The 2 points from the device designated by
These 2 points from the device designated by
Changing these points may cause an error code to be returned (Error code: 4100).
(6) If the value of n is changed during the execution of the SORT instruction, the sort will be conducted in accordance with
the number of sort data blocks after the change.
(7) If the execution command is turned OFF during the execution of the SORT instruction, the sort is suspended. The sort
resumes from the beginning when the execution command is turned ON again.
(8) To execute another sort operation immediately after the completion of the previous sort, turn OFF the execution
command once, then turn it ON.
DSORT
(1) Sorts (rearranges data) BIN 32-bit data n points from
Sort order is designated by the ON/OFF status of SM703:
• When SM703 is OFF : Ascending order sort
• When SM703 is ON : Descending order sort
Data before sort When SM703 = OFF
35000
+1 ,
S1
S1
-1000
+3 ,
+2
S1
S1
+5 ,
+4
S1
S1
-124
+7 ,
+6
S1
S1
(2) Several scans are required for sorts performed by the DSORT 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
value of
is increased, the number of scans until completion of the sort is reduced, but the amount of time per scan is
S2
lengthened.
(3) The maximum number of executions until completion of the sort should be calculated according to the following
equation:
The maximum number of executions until completion
Example
When n 10, the number of executions is obtained as 10
scans until the completion of sort is calculated as 45/2 22.5
(4) The device designated by
ON when the sort is completed. Because the device designated by
of the sort, the user must turn it OFF if required.
(5) The 2 points from the device designated by
These 2 points from the device designated by
Changing these points may cause an error code to be returned (Error code: 4100).
(6) If the value of n is changed during the execution of the SORT instruction, the sort will be conducted in accordance with
the number of sort data blocks after the change.
(7) If the execution command is turned OFF during the execution of the SORT instruction, the sort is suspended. The sort
resumes from the beginning when the execution command is turned ON again.
(8) To execute another sort operation immediately after the completion of the previous sort, turn OFF the execution
command once, then turn it ON.
376
are used by the system during the execution of the SORT instruction.
D2
should therefore not be used by the user.
D2
+1 ,
S1
+3 ,
S1
+5 ,
S1
+7 ,
S1
500
+1 ,
S1
+3 ,
S1
When SM703 = ON
+5 ,
S1
+7 ,
S1
(the completion device) is turned OFF by the execution of the SORT instruction, and turned
D1
are used by the system during the execution of a DSORT instruction.
D2
should therefore not be used by the user.
D2
in ascending or descending order.
S1
S1
-1000
-124
S1
+2
Sort in the ascending order
+4
500
S1
35000
+6
S1
35000
S1
500
+2
S1
Sort in the descending order
-124
+4
S1
-1000
S1
+6
. (Decimal fractions are rounded up.) When the
S2
(n)
(n-1)/2 [times executed]
(10-1)/2 45 [times executed]. If S2 2, then the number of
23 [scans].
is maintained in the ON state after the completion
D1

Advertisement

Table of Contents
loading

Table of Contents