FX Series Programmable Controlers Applied Instructions 5
5-6
X22
P 10CJ
P10
e) A CJ instruction can be used to Jump forwards
through a program, i.e. towards the END instruction
OR it can jump backwards towards step 0. If a
backwards jump is used care must be taken not to
overrun the watchdog timer setting otherwise the
PLC will enter an error situation. For more
information on the watchdog timer please see page
5-12.
f) Unconditional jumps can be entered by using special auxiliary coils such as M8000. In this
situation while the PLC is in RUN the program will ALWAYS execute the CJ instruction in an
unconditional manner.
IMPORTANT:
• Timers and counters will freeze their current values if they are skipped by a CJ instruction.
For example if Y1 in the previous program (see point c) was replaced by T0 K100 and the
CJ instruction was driven, the contents of T0 would not change/increase until the CJ
instruction is no longer driven, i.e. the current timer value would freeze.
High speed counters are the only exception to this situation as they are processed
independently of the main program.
Using applied instructions:
• Applied instructions are also skipped if they are programmed between the CJ instruction
and the destination pointer. However, The PLSY (FNC 57) and PWM (FNC 58) instructions
will operate continuously if they were active before the CJ instruction was driven, otherwise
they will be processed, i.e. skipped, as standard applied instructions.
Details of using CJ with other program flow instructions
• Further details can be found on pages 7-12 and 7-13 about the combined use of
different
program flow techniques (such as master control, MC etc).