Skip to main content

Example - Ladder Diagram

XCH


The XCH instruction exchanges the value in the WORD data register, D1, with the value in the WORD data register, D2.

Ladder Diagram Example


When the contact, M0.0, is powered ON (1), the instruction exchanges the value of the WORD data register, D0, with the data register, D2.


Memory Monitor

XCHP


The XCHP one-shot instruction exchanges the value in the WORD data register, D1, with the value in the WORD data register, D2.
Every time this instruction executes, it energizes the output only once.

Ladder Diagram Example


When the contact, M0.1, is powered ON (1), the instruction exchanges the value of the WORD data register, D5, with the data register, D7.


Memory Monitor