beautypg.com

Delta Electronics Extension Digital I/O Module DOP-EXIO14RAE User Manual

Page 83

background image

Appendix D Use of Application Instructions|DOP-EXIO Series

D-2

Revision March, 2008, Doc. Name: 2007PDD23000014

Mnemonic

Operands Function

CJ

S

Conditional Jump

Bit Devices

Word Devices

X Y M S K H

KnX

KnY

KnM KnS

T

C

D

E

F

y

Note:

1. Operand S can designate P.

2. P can be modified by index register E, F.

16-bit instruction (3 Steps)

CJ

Continuous
execution

32-bit instruction

- -

- -

y

Flags: None

Operands:

S

: The destination pointer of conditional jump

Explanations:
1. When the user does not wish a particular part of DOP-EXIO program in order to shorten the scan

time and execute dual outputs, CJ instruction or CJP instruction can be adopted.

2. When the program designated by pointer P is prior to CJ instruction, WDT timeout will occur and

DOP-EXIO will stop running. Please use it carefully.

3. CJ instruction can designate the same pointer P repeatedly. However, CJ and CALL cannot

designate the same pointer P; otherwise an error will occur.

Program Example 1:
1. When X0 = On, the program automatically jumps from address 0 to N (the designated label P1)

and keeps its execution. The addresses between 0 and N will not be executed.

2. When X0 = Off, as an ordinary program, the program keeps on executing from address 0. CJ

instruction will not be executed at this time.

X0

X1

X2

CJ

P1

Y1

Y2

0

N

P1

P***

(

)

CJ instruction

Program Example 2:

1.

CJ instruction can be used in the following 5 conditions between MC and MCR instructions.

a)

Without MC ~ MCR.

b)

From without MC to within MC. Valid in the loop P1 as shown in the figure below.

c)

In the same level N, inside of MC~MCR.

d)

From within MC to without MCR.

e)

Jumping from this MC ~ MCR to another MC ~ MCR