The leader in industrial automation and control solutions

Instruction Parameters

Supported PLC Series

PLC-AESPLC-FBPLC-ES

Supported Data Registers

MXYKLFTCSZRQD@DConstant
D

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1
CarryF11.2

Number of Steps

Steps
3

Operands

OperandDescription
DThe only operand.
Entries are only WORD data registers.
This is the value that swaps the lower byte with the upper byte.

The signed value range is -32,768 ~ 32,767 (216).
The unsigned value range is 0 ~ 65,535 (216-1).
The Hexadecimal value range is H0000 ~ HFFFF.

Notice

Error Flag (F11.0) Notice

The error flag, F11.0, will be ON for one scan when the address of the data register assigned by @D exceeds the range of the data register, D. The range of the data register, D, is dependent on the CPU type.

Execution Condition

It is recommended that the SWAP instructions be used with a pulse contact as an execution condition, or use the SWAPP instruction.

Ladder Diagram Examples

SWAP

The SWAP instruction swaps the upper byte of the WORD data register, D, with the lower byte of the WORD data register, D.

The SWAP instruction swaps the upper byte of the WORD data register, D, with the lower byte of the WORD data register, D.

When the contact, M0.1 is ON (1), the instruction swaps the upper byte of the data register, D50, with the lower byte of the same data register.

When the contact, M0.1 is ON (1), the instruction swaps the upper byte of the data register, D50, with the lower byte of the same data register.

Ladder Diagram Example for MapleLogic SWAP/SWAPP instruction.

Memory Monitor

Memory Monitor for MapleLogic SWAP/SWAPP instruction.
Memory Monitor for MapleLogic SWAP/SWAPP instruction.

SWAPP

The SWAPP one-shot instruction swaps the upper byte of the WORD data register, D, with the lower byte of the WORD data register, D.

The SWAPP one-shot instruction swaps the upper byte of the WORD data register, D, with the lower byte of the WORD data register, D. Every time this instruction executes, it energizes the output only once.

When the contact, M0.1 is ON (1), the instruction swaps the upper byte of the data register, D55, with the lower byte of the same data register.

When the contact, M0.1 is ON (1), the instruction swaps the upper byte of the data register, D55, with the lower byte of the same data register.

Ladder Diagram Example for MapleLogic SWAP/SWAPP instruction.

Memory Monitor

Memory Monitor for MapleLogic SWAP/SWAPP instruction.
Memory Monitor for MapleLogic SWAP/SWAPP instruction.