Mitsubishi — Chapter 6 Application Instructions API 00-49

6 Application Instructions API 00-49 Program Example 2: When X7 = Off, PLC will execute the program between FOR ~ NEXT. When X7 = On, CJ instruction jumps to P6 and avoids executing the programs between FOR ~ NEXT. X7 M0 M0 X10 MEXT P6 Y10 Program Example 3: When the programs between FOR ~ NEXT are not to be executed, the user can adopt CJ instruction for a jumping. When the most inner FOR ~ NEXT loop is in the status of X1 = On, CJ instruction executes jumping to P0 and skips the execution on P0.

P0 DVP-PLC Application Manual 6-19 CJ P6 MOV K0 D0 FOR K3 MOV D0 D1 INC D0 X0 TMR T0 K10 FOR K4X100 X0 INC D0 FOR K2 X0 INC D1 FOR K3 X0 INC D2 FOR K4 X0 WDT INC D3 X1 CJ P0 FOR K5 X0 INC D4 NEXT NEXT NEXT NEXT NEXT END TMR T0 K10 FOR K4X100 INC D0 FOR K2 INC D1 FOR K3 INC D2 FOR K4 INC D3 CJ P0 FOR K5 INC D4