AS Series Programming Manual Symbol S 1 : Data to exchange S 2 : Data to exchange _6 Explanation 1. This instruction exchanges the data in the device specified by S 1 with the data in the device specified by S 2 . 2. Only the 32-bit instructions can use the 32-bit counter, but not the device E. When X0.0 is switched from OFF to ON, the instruction exchanges the data in D20 with the data in D40. Example 1 Before the instruction is executed: After the instruction is executed: D20 120 40 D20 D40 40 120 D40 Example 2 When X0.0 switches from OFF to ON, the instruction exchanges the data in D100 with the data in D200. Before the instruction is executed: After the instruction is executed:
D100 D101 20 9 40 8 D100 D101 D200 8 9 D200 D201 40 20 D201 6-136 API Instruction code Operand Function 0306 D XCH P S1, S2 Exchanging data Device X Y M S T C HC D FR SM SR E K 16# “$” F S1 S2 BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S1 S2 Pulse instruction 16-bit instruction 32-bit instruction AS AS AS