Swap (Swap Bytes) Instruction - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents
The FILL_BLK and UFILL_BLK instructions copy the source data element IN to the
destination where the initial address is specified by the parameter OUT. The copy process
repeats and a block of adjacent addresses is filled until the number of copies is equal to the
COUNT parameter.
FILL_BLK and UFILL_BLK instructions differ in how interrupts are handled:
● Interrupt events are queued and processed during FILL_BLK execution. Use the
● Interrupt events are queued but not processed until UFILL_BLK execution is complete.
Table 7- 70

SWAP (Swap bytes) instruction

Table 7- 71
SWAP instruction
out := SWAP(in);
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
FILL_BLK instruction when the data at the move destination address is not used within an
interrupt OB subprogram or, if used, the destination data does not have to be consistent.
Use the UFILL_BLK instruction when the move operation must be completed and the
destination data consistent, before the execution of an interrupt OB subprogram.
ENO status
No error
The destination (OUT) range exceeds
the available memory area
Reverses the byte order for two-byte and four-byte data elements. No change
is made to the bit order within each byte. ENO is always TRUE following
execution of the SWAP instruction.
7.6 Move operations
The IN element was successfully copied to
all COUNT destinations.
Elements that fit are copied. No partial
elements are copied.
Basic instructions

Hide quick links:

Table of Contents

Table of Contents