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

Page 106

Advertising
background image

Appendix D Use of Application Instructions|DOP-EXIO Series

Revision March, 2008, Doc. Name: 2007PDD23000014

D-25

Mnemonic

Operands Function

XCH

D

D

1

D

2

Exchange

Bit Devices

Word Devices

X Y M S K H

KnX

KnY

KnM KnS

T

C

D

E

F

D

1

D

2

y

Note:

1. If

D

1

and D

2

are used in device F, only 16-bit instruction is applicable.

16-bit instruction (5 Steps)

XCH

Continuous
execution

32-bit instruction (9 Steps)

DXCH

Continuous
execution

y

Flags: None

Operands:

D

1

: Data to be exchanged 1

D

2

: Data to be exchanged 2

Explanations:
The contents in the devices designated by D

1

and D

2

will exchange.

Program Example 1:
When X0 = Off→On, the contents in D20 and D40 exchange with each other.

X0

D40

XCHP

D20

Before

execution

After

execution

120

120

40

40

D20

D40

D20

D40

Program Example 2:
When X0 = Off → On, the contents in D100 and D200 exchange with each other.

X0

D200

D100

Before

execution

After

execution

40

20

D100

D101

D100

D101

20

40

D200

D201

D200

D201

DXCHP

Advertising