1029
Text String Processing Instructions Section 3-31
3-31-11 EXCHANGE STRING: XCHG$(665)
Purpose Replaces a designated text string with another designated text string.
Ladder Symbol
Variations
Applicable Program Areas
Operands Ex1: First Exchange Word 1
Ex2: First Exchange Word 2
Note (1) The data from Ex1 to Ex1 + the maximum 2,047 words and from Ex2 to
Ex2 + the maximum 2,047 words must be in the same area.
(2) The data from Ex1 to Ex1 + the maximum 2,047 words and from Ex2 to
Ex2 + the maximum 2,047 words cannot overlap.
Operand Specifications
XCHG$(665)
Ex1
Ex2
Ex1: First exchange word 1
Ex2: First exchange word 2
Variations Executed Each Cycle for ON Condition XCHG$(665)
Executed Once for Upward Differentiation @XCHG$(665)
Executed Once for Downward Differentiation Not supported
Immediate Refreshing Specification Not supported
Block program areas Step program areas Subroutines Interrupt tasks
OK OK OK OK
15 0
Ex1
to
Text string data: 4,095 characters max. + NUL
Ex1 + maximum 2,047 words
15 0
to
Ex2
Text string data: 4,095 characters max. + NUL
Ex2 + maximum 2,047 words
Area Ex1 Ex2
CIO Area CIO 0 to CIO 6143
Work Area W0 to W511
Holding Bit Area H0 to H511
Auxiliary Bit Area A448 to A959
Timer Area T0000 to T4095
Counter Area C0000 to C4095
DM Area D0 to D32767
Indirect DM addresses
in binary
@ D0 to @ D32767
Indirect DM addresses
in BCD
*D0 to *D32767