Swap Byte (Swpb); Relay Ladder - Allen-Bradley Logix5000 Reference Manual

1756 controllogix, 1768 compactlogix, 1769 compactlogix, 1789 softlogix, 1794 flexlogix, powerflex 700s with drivelogix
Hide thumbs Also See for Logix5000:
Table of Contents

Advertisement

Move/Logical Instructions (MOV, MVM, BTD, MVMT, BTDT, CLR, SWPB, AND, OR, XOR, NOT, BAND, BOR, BXOR, BNOT)

Swap Byte (SWPB)

Operand
Type
Source
INT
DINT
REAL
Order Mode
Destination
INT
DINT
REAL
The SWPB instruction rearranges the bytes of a value.
Operands:

Relay Ladder

Format
Enter
Tag
Tag that contains the bytes that you want to rearrange
If the source is
an
INT
DINT
REAL
Tag
Tag to store the bytes in the new order
If the source is
an
INT
DINT
REAL
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
And you want to change the bytes to this
pattern (each letter represents a
different byte)
N/A
ABCD ? DCBA
ABCD ? CDAB
ABCD ? BADC
Then the destination must be an
INT
DINT
DINT
REAL
Chapter 7
Then select
Any of the options
REVERSE (or enter 0)
WORD (or enter 1)
HIGH/LOW (or enter 2)
311

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents