7 Application Instructions API 50-99 API 69 Operands: S : Start device for the original data m 1 : Groups of data to be sorted m 2 : Number of columns of data D : Start device for the sorted data n : Reference value for data sorting Explanations: 1. Range of m 1 : 1 ~ 32. 2. Range of m 2 : 1 ~ 6 3. Range of n : 1 ~ m 2 4. See the specifications of each model for their range of use. 5. Flag: M1029 (SORT execution completed). 6. The sorted result is stored in m 1 Ч m 2 registers starting from the device designated in D . Therefore, if S and D designate the same register, the sorted result will be the same as the data designated in S . 7. It is better that the start No. designated in S is 0. 8.
The sorting will be completed after m 1 times of scans. After the sorting is completed, M1029 will be On. 9. There is no limitation on the times of using this instruction. However, only one instruction can be executed at a time. 10. The function of sorting one-dimensional data is added. If users set m 1 and m 2 to 1, the function will be enabled. The operand n represents the number of data. It must be in the range of 1 to 32. The data in the n devices starting from S is sorted. The sorting result is stored in the devices starting from D . This function only needs one scan time. After data is sorted. M1029 will be ON.
This function supports DVP-EH3 series PLCs whose version is 1.62, DVP-SV2 series PLCs whose version is 1.62, DVP-SX series PLCs whose version is 3.0, and above. 11. The 32-bit instruction DSORT is added. It supports DVP-EH3 series PLCs whose version is 1.62, DVP-SV2 series PLCs whose version is 1.62, DVP-SX seires PLCs whose version is 3.0, and above. Program Example: 1. When X0 = On, the sorting will start. When the sorting is completed, M1029 will be On. DO NOT change the data to be sorted during the execution of the instruction. If you wish to change the data, please make X0 go from Off to On again.
X0 DVP-PLC APPLICATION MANUAL 7-71 Mnemonic Operands Function D SORT Sort Tabulated Data Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F SORT: 11 steps DSORT: 21 steps S * m 1 * * m 2 * * D * n * * * PULSE 16-bit 32-bit SA SX SC EH SV EH SV 3 ES 2 EX SS EH3 ES EX SS EH3 ES EX SS SA SX SC EH SV SA SX SC EH SV SV2 SV2 SORT D0 K5 K5 D50 D100