Swp - Swap - Allen-Bradley MicroLogix 1400 Instruction Manual

Programmable controllers
Hide thumbs Also See for MicroLogix 1400:
Table of Contents
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive
286
File Instructions

SWP - Swap

SWP
SWP
Swap
Source
#ST10:1.DATA[0]
Length
13
SWP Instruction Valid Addressing Modes and File Types
For definitions of the terms used in this table see Using the Instruction Descriptions on page 92.
Parameter
Source
Length
(1) See Important note about indirect addressing.
SWP
SWP
Swap
Source
#ST10:1.DATA[0]
Length
13
Publication 1766-RM001A-EN-P - October 2008
Instruction Type: output
Execution Time for the SWP Instruction
Controller
MicroLogix 1400
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...128. For the string filetype, the
length range is 1...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:
Data Files
You cannot use indirect addressing with: S, MG, PD, RTC, HSC, PTOX,
IMPORTANT
PWMX, STI, EII, BHI, MMI, CS, IOS, and DLS files.
Example:
Source Value before executing SWP instruction: a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g
Source Value before executing SWP instruction: b a d c f e h g j i l k n m p o r q t s v u x w z y a b c d e f g
The underlined characters show the 13 words where the low byte was
swapped with the high byte.
When Rung Is:
True
1.0728 µs
Function Files
False
0.1963 µs
(1)
Address
Address Level
Mode

Hide quick links:

Table of Contents
loading

Table of Contents