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

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

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
ENO
1
0
7.6.4

SWAP (Swap bytes) instruction

Table 7- 71
SWAP instruction
LAD / FBD
SCL
out := SWAP(in);
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
1
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
Condition
No error
The destination (OUT) range exceeds
the available memory area
Description
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
Result
The IN element was successfully copied to
all COUNT destinations.
Elements that fit are copied. No partial
elements are copied.
Basic instructions
243

Advertisement

Table of Contents
loading

Table of Contents