7 Application Instructions API 50-99 API 61 Operands: S 1 : Start device for data stack comparison S 2 : Data to be compared D : Start device for storing comparison result n : Length of data to be compared Explanations: 1. When S 2 are used in device F, only 16-bit instruction is applicable. 2. D will occupy 5 consecutive points. 3. Range of n : for 16-bit instruction 1 ~ 256; for 32-bit instruction 1 ~ 128. 4. See the specifications of each model for their range of use. 5. The n data in the registers starting from S 1 are compared with S 2 and the results are stored in the registers starting from D . 6. In the 32-bit instruction, S 1 , S 2 , D and n will designate 32-bit registers. 7.
For D , the 16-bit counters and 32-bit counters in SA/SX/SC series MPU cannot be mixed when being used. Program Example: 1. When X0 = On, the data stack consist of D10 ~ D19 will be compared against D0 and the result will be stored in 2. The data are compared algebraically. (-10 D50 ~ D52. If there are equivalent values appearing during the comparison, D50 ~ D52 will all be 0. 3. The No. of the register with the smallest value among the compared data will be recorded in D53; the biggest will be recorded in D54. When there are more than one smallest value or biggest value, device D will record the No. of the register with bigger value.
X0 DVP-PLC APPLICATION MANUAL 7-49 Mnemonic Operands Function D SER P Search a Data Stack Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F SER, SERP: 9 steps DSER, DSERP: 17 steps S 1 * * * * * * * S 2 * * * * * * * * * * * D * * * * * * n * * * PULSE 16-bit 32-bit EH3 V SV2 ES EX SS EH3 ES EX SS EH3 ES EX SS SA SX SC EH S SA SX SC EH SV SA SX SC EH SV SV2 SV2 SER D10 D0 D50 K10