100 D50 PLC User's Manual
Instruction
Mnemonic Data Exchange Range
Bit
■ Byte
XCHG
DXCHG
Exchange registers of D1, D2 with
each other
■ Word
Ladder
Exchange registers D1 and D2 (byte /word) with each other.
D1 => D2, D2 => D1
Description
1. Exchange registers D1 and D2 with each other (byte/word). For example:
Byte operation: D1 = $1234 (hex) D2 = $1278 (hex)
D1 = $5678 (hex) D2 = $5634 (hex)
Word operation: D1 = $1234 (hex) D2 = $5678 (hex)
D1 = $5678 (hex) D2 = $1234 (hex)
2. This operation will occur on every scan for which the input condition is true (On). To perform
the operation only on a change of input condition, use the rising/falling edge contact.
Example
Program Expression Operation Results
Initial conditions: W0 = $1234
W1 = $5678
W10 = $5678
W11 = $1234
Operation results: W0 = $1278
W1 = $5634
W10 = $1234
W11 = $5678
XCHG
D1 =
D2 =
R
R
DXCHG
D1 =
D2 =
D1 .. 0 1 0 1 D1 .. 0 0 1 1
D2 ... 0 0 1 1 D2 .. 0 1 0 1
XCHG
D1 = W0
D2 = W1
DXCHG
D1 = W10
D1 = W11
R0.0
R
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com