Mitsubishi — 5.6 Descriptions of the Applied Instructions

Chapter 5 Applied Instructions 5.6 Descriptions of the Applied Instructions API 00  S : Pointer which points to a jump destination  A pointer is in the range of P0~P255.  If some part of the main program O100 does not need to be executed, users can use CJ or CJP to shorten the scan time. Besides, if a dual output is used, users can use CJ or CJP.  If the program specified by a pointer is prior to the instruction CJ, a watchdog timer error will occur, and the main program will not be executed. Please use the instruction carefully.  The instruction CJ can specify the same pointer repeatedly.

The pointer specified by CJ can not be the same as the pointer specified by CALL, otherwise an error will occur.  When the instruction CJ/CJP in a program is executed, the actions of the devices in the program are as follows. • The states of the Y devices, the states of the M devices, and the states of the S devices in the program remain the same as those before the execution of the jump. • The 10 millisecond timers in the program stop counting. • The general counters in the program stop counting, and the general applied instructions in the program are not executed.

• If the instructions which are used to reset the timers in the program are driven before the jump is executed, the timers will still be reset during the execution of the jump. Explanation  When X0.0 is ON, the execution of the program jumps from address 0 to address N (P1).  When X0.0 is OFF, the execution of the program starts from address 0, and the instruction CJ is not executed. Example 1 ( ) Jump instruction 0 N 5-19 Instruction code Operand Function CJ P S Conditional jump Device Xn.n Yn.n M S K 16# F KnM KnS D W T C V Z S Pulse instruction 16-bit instruction (3 steps) 32-bit instruction   – CJ P1 X0.1 Y0.1 P1 X0.2 Y0.2 CJ P1