Chapter 7
Move/Logical Instructions (MOV, MVM, BTD, MVMT, BTDT, CLR, SWPB, AND, OR, XOR, NOT, BAND, BOR, BXOR, BNOT)
SWPB(Source,OrderMode,Dest);
Description:
bar code reader
B A
42969
A B
Arithmetic Status Flags:
Fault Conditions:
Condition
Prescan
Rung-condition-in is false
Rung-condition-in is true
EnableIn is set
Instruction execution
Postscan
312
Structured Text
The operands are the same as those for the relay ladder SWPB instruction. If you select
the HIGH/LOW order mode, enter it as HIGHLOW or HIGH_LOW (without the
slash).
The SWPB instruction rearranges the order of the bytes of the Source. It places the result
in the Destination.
When you read or write ASCII characters, you typically do not need to swap characters.
The ASCII read and write instructions (ARD, ARL, AWA, AWT) automatically swap
characters, as shown below.
Not affected
None
Execution:
Relay Ladder Action
The rung-condition-out is set to false.
The rung-condition-out is set to false.
The rung-condition-out is set to true.
N/A
The instruction rearranges the specified bytes.
The rung-condition-out is set to false.
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Tag Name
bar_code[0]
42968
Structured Text Action
No action taken
N/A
N/A
EnableIn is always set.
The instruction executes.
The instruction rearranges the specified bytes.
No action taken.
Value
Style
Type
AB
ASCII
INT