EasyManuals Logo
Home>Allen-Bradley>Controller>MicroLogix 1100

Allen-Bradley MicroLogix 1100 Instruction Set Reference Manual

Allen-Bradley MicroLogix 1100
616 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #238 background imageLoading...
Page #238 background image
Publication 1763-RM001C-EN-P - October 2009
238 File 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.
Addressing Modes and File Types can be used as shown in the following
table:
Example:
Source Value before executing SWP instruction: abcdefghijklmnopqrstuvwxyzabcdefg
Source Value before executing SWP instruction: badcfehgjilknmporqtsvuxwzy
abcdefg
The underlined characters show the 13 words where the low byte was
swapped with the high byte.
SWP
Swap
Source #ST10:1.DATA[0]
Length 13
SWP
Execution Time for the SWP Instruction
Controller When Rung Is:
True False
MicroLogix 1100 9.15 μs + 0.43 μs/swapped word 0.87 μs
SWP Instruction Valid Addressing Modes and File Types
For definitions of the terms used in this table see Using the Instruction Descriptions on page 82.
Parameter
Data Files Function Files
CS - Comms
IOS - I/O
DLS - Data Log
Address
(1)
Mode
Address Level
O
I
S
B
T, C, R
N
F
ST
L
MG, PD
RI/RIX
PLS
RTC
HSC
PTO, PWM
STI
EII
BHI
MMI
LCD
Immediate
Direct
Indirect
Bit
Word
Long Word
Element
Source ••• • • •
Length
• •
(1) See Important note about indirect addressing.
IMPORTANT
You cannot use indirect addressing with: S, ST, MG, PD,
RTC, HSC, PTO, PWM, STI, EII, BHI, MMI, CS, IOS, and
DLS files.
SWP
Swap
Source #ST10:1.DATA[0]
Length 13
SWP
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive

Table of Contents

Other manuals for Allen-Bradley MicroLogix 1100

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Allen-Bradley MicroLogix 1100 and is the answer not in the manual?

Allen-Bradley MicroLogix 1100 Specifications

General IconGeneral
BrandAllen-Bradley
ModelMicroLogix 1100
CategoryController
LanguageEnglish

Related product manuals