Chapter 6: Instructions
125
Instruction
Mnemonic
Data Exchange
Range
Bit
■
Word
XCHG
DXCHG
Exchange registers of D1, D2 with
each other
■
Double words
Ladder
Exchange registers D1 and D2 (word /double word) with each other.
D1 => D2, D2 => D1
Description
1. Exchange registers D1 and D2 with each other (word/double word). For example:
Word operation:
D1 = $1234 (hex)
D2 = $5678 (hex)
D1 = $5678 (hex)
D2 = $1234 (hex)
Double word operation:
D1 = $12345678 (hex)
D2 = $9ABCDEF0 (hex)
D1 = $9ABCDEF0 (hex) D2 = $12345678 (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
W12 = $DEF0
W13 = $9ABC
Operation results:
W0 = $5678
W1 = $1234
W10 = $DEF0
W11 = $9ABC
W12 = $5678
W13 = $1234
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 = W12
R0.0
R
Содержание D320 PLC
Страница 1: ...D320 PLC User s Manual...
Страница 18: ...6 D320 PLC User s Manual...
Страница 28: ...16 D320 PLC User s Manual...
Страница 34: ...22 D320 PLC User s Manual...
Страница 78: ...66 D320 PLC User s Manual...
Страница 176: ...164 D320 PLC User s Manual...
Страница 210: ...198 D320 PLC User s Manual...
Страница 258: ...246 D320 PLC User s Manual...