5 Categories and Use of Basic Application Instructions API 08 Operands: S : The number of times for the loop to be repeated Explanations: 1. No contact to drive the instruction is required. 2. The nested RPT ~ RPE loop can only be 1 level. Errors will occur when the number of levels is more than 1. API 09 Explanations: 1. RPT instruction executes the RPT-RPE loop back and forth for “N” times tehn return to the instruction after the RPT-RPE loop. 2. N = K1 ~ K32,767. N is regarded as K1 when N ≦ K1. 3. CJ instruction can be used to skip or jump out of RPT-RPE loop. 4. An error will occur in the following conditions: - RPE instruction is placed before RPT instruction.
- RPT instruction exists, but RPE instruction does not exist. - Number of RPT instructions differs from that of RPE instructinos. 5. The nested RPT ~ RPE loop can only be 1 level. Errors will occur when the number of levels is more than 1. Program Example 1: If you would like program section A to execute for 3 times, you can use RPT-RPE written as follows: A RPE Program Example 2: When X7 = OFF, PLC will execute the program between RPT and RPE. When X7 = ON, CJ instruction jumps to P6 and avoids executing the instructions between RPT and RPE.
DVP-PM Application Manual 5-21 Mnemonic Operands Function Controllers 20PM 10PM RPT Start of a Nested RPT-RPE loop Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D V Z RPT: 3 steps S * * * * * * * * * * Mnemonic Function Controllers 20PM 10PM RPE End of a Nested RPT-RPE loop Controllers 20PM 10PM OP Descriptions Program Steps N/A No operand. No contact to drive the instruction is required. RPE: 1 steps RPT K3