Swap (Swp); Entering Parameters - Allen-Bradley SLC 500 Series Reference Manual

Hide thumbs Also See for SLC 500 Series:
Table of Contents
4-28
Math Instructions

Swap (SWP)

SWP
SWP
Swap
Source #ST10:1.DATA[0]
Length
Fixed SLC
SLC
SLC
5/01
5/02
5/03
Output Instruction
Publication 1747-RM001G-EN-P - November 2008
Use this instruction to swap the low and high bytes of a specified number of
words in a bit, integer, ASCII, or string file. Use this instruction with SLC 5/03
(OS302), SLC 5/04 (OS401), and SLC 5/05 processors.

Entering Parameters

Enter the following parameters when programming this instruction.
5
• Source can only be an indexed word address
SLC
SLC
• Length refers to the number of words to be swapped, regardless of the
5/04
5/05
file type. The address is limited to integer constants. For bit, integer, and
ASCII file types, the length range is 1 to 128. For the string file type, 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.
The following example shows how the SWP instruction works.
Before:
ST10:1 = abcdefghijklmnopqrstuvwxyz
After
ST10:1 = badcfehgjilknmporqtsvuxwzy
SWP
SWAP
Source
#ST10:1.1
Length
13
Table of Contents
loading

Table of Contents