7 APPLICATION INSTRUCTION
7.2 Program branch instruction
327
7
• These instructions can specify and jump from the current step to a smaller step number. In this case, consider a method to
exit a loop so that the watchdog timer does not time out.
• The value in the device skipped with these instructions remains the same.
• A label (P) occupies two steps.
• Only the pointer numbers within the same program file can be specified.
• During skip operation, if the program jumps to the pointer number within the skip range, the programs of the jump
destination pointer number and later are executed.
• The figure below shows programming of a label. When creating a circuit program, move the cursor to the left side of the bus
line in the ladder diagram, and input a label (P) at the head of the circuit block.
• A label can be programmed in a smaller number step than CJ instruction. However, note that a watchdog timer error occurs
when the scan time exceeds 200 ms (default setting).
(1) While X3 is on, the loop is repeated.
(2) To exit the loop, turn on X7.
When X2 turns on, the program jumps to the label, P19.
Y4 and Y5 remain the same even if X2 and X4 turn on/off during the
execution of the CJ instruction.
(1) A label occupies two steps.
(1)
P8
Label
Label
X0
X7
X3
X6
P9
CJ P9
P8CJ
Y5
(2)
Y4
X7
X2
P19
P19CJ
X2
X4
Label
Y4
Y5
Y6
(1)
23
29
M36
X5
X2
19
15
10
P9
P9CJ
M3
X3
Label
Y2
Y5
Y6
Y7
X32
X30
P20CJ
X31
Y10
Y11
Bus line
Label
Label
P20