5 Categories and Use of Basic Application Instructions API 256 Operands: S : The destination pointer P of the negated conditional jump Explanations: 1. P cannot be modified by index registers V, Z. 2. When CJN instruction is ON, the program flow will proceed with the row after the CJN instruction. When CJN 3. If you need to skip a particular part of PLC program to shorten the scan time or execute dual outputs, CJN instruction is OFF, program flow will jump to the address designated by pointer P. instruction or CJN P instruction can be adopted. 4. When the program designated by pointer P is prior to CJN instruction, WDT timeout will occur and PLC will stop running. Please use it carefully. 5.
CJN instruction can designate the same pointer P repeatedly. However, CJN and CALL cannot designate the same pointer P; otherwise operation error will occur. 6. Actions of all devices while CJN is OFF and conditional jump is being executed: a) Y, M and S remain their previous status before the conditional jump takes place. b) The executing 10ms timer stops. c) General counters stop executing and general application instructions are not executed. d) If timer is reset before CJ instruction executes, the timer will still be in the reset status while CJ instruction is being executed. Program Example 1: 1.
When X0 = OFF, the program will skip from address 0 to N (Pointer P1) automatically and keep on executing. 2. When X0 = ON, program flow will proceed with the row immediately after the CJN instruction. Instructions between address 0 and N will be skipped. X0 (CJN instruction) 0 X1 Y1 N P1 X2 Y2 DVP-PM Operation Instruction 5-140 Mnemonic Operands Function Controllers 20PM 10PM CJN P Negated Conditional Jump OP Range Program Steps P0 ~ P255 CJN, CJNP: 3 steps CJN P1