Publication 1762-RM001C-EN-P
10-10 Math Instructions
SWP - Swap
Instruction Type: output
Use the SWP instruction to swap the low and high bytes of a specified
number of words in a bit, integer, or string file. The SWP instruction has 2
operands:
•
Source is the word address containing the words to be swapped.
•
Length is the number of words to be swapped, regardless of the file
type. The address is limited to integer constants. For bit and integer
filetypes, the length range is 1 to 128. For the string filetype, the
length range is 1 to 41. Note that this instruction is restricted to a
single string element and cannot cross a string element boundary.
SWP
Swap
Source #ST10:1.DATA[0]
Length 13
SWP
Table 10.13 Execution Time for the SWP Instruction
Controller When Rung Is:
True False
MicroLogix 1200 Series B and higher 13.7
µ
s + 2.2
µ
s/swapped word 0.0
µ
s
MicroLogix 1500 Series B and higher 11.7
µ
s + 1.8
µ
s/swapped word 0.0
µ
s