Mitsubishi — 5.6 Descriptions of the Applied Instructions

Chapter 5 Applied Instructions  RPT in a program specifies that the RPT-RPE loop in the program must be executed N times.  N is in the range of K1 to K32,767. If N ≦ K1, N will be regarded as K1.  Users can skip the execution of the RPT-RPE loop in a program by means of the instruction CJ.  An error will occur if  the instruction RPE is before the instruction RPT  there is RPT, but there is no RPE  the number of times RPT is used is not the same as the number of times RPE is used  There is only one RPT-RPE loop in a program. If there is more than one RPT-RPE loop in a program, an error will occur. Explanation  Part A can be executed three times by means of a RPT-RPE loop.

Example 1 A RPE  When X0.7 is OFF, the program between RPT and RPE is executed. When X0.7 is ON, the instruction CJ is executed, the subroutine to which P6 points is executed, and the program between RPT and RPE is skipped. Example 2 X0.7 M0 M0 RPE Y1.0 X1.0 P6 5-27 PI Instruction code Operand Function 09 RPE – End of a nested loop Pulse instruction 16-bit instruction (1step) 32-bit instruction –  – RPT K3 .7 CJ P6 MOV K0 D0 RPT K3 MOV D0 D1 INC D0