Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 303
Move/Logical Instructions (MOV, MVM, BTD, MVMT, BTDT, CLR, SWPB, AND, OR, XOR, NOT, BAND, BOR, BXOR, BNOT) Chapter 7
Bit Field Distribute (BTD)
The BTD instruction copies the specified bits from the Source, shifts the bits to the
appropriate position, and writes the bits into the Destination.
This instruction is available in structured text and function block as BTDT,
see page 306
.
Operands:
Relay Ladder
Description: When enabled, the BTD instruction copies a group of bits from the Source to the
Destination. The group of bits is identified by the Source bit (lowest bit number of the
group) and the Length (number of bits to copy). The Destination bit identifies the lowest
bit number bit to start with in the Destination. The Source remains unchanged.
If the length of the bit field extends beyond the Destination, the instruction does not save
the extra bits. Any extra bits do not wrap to the next word.
If you mix integer data types, the instruction fills the upper bits of the smaller integer data
types with 0s so that they are the same size as the largest data type.
Arithmetic Status Flags: Not affected
Fault Conditions: None
Operand Type Format Description
Source SINT
INT
DINT
Immediate
Tag
Tag that contains the bits to move
A SINT or INT tag converts to a DINT value by zero-fill.
Source bit DINT Immediate
(0-31 DINT)
(0-15 INT)
(0-7 SINT)
Number of the bit (lowest bit number) from where
to start the move
Must be within the valid range for the Source data
type
Destination SINT
INT
DINT
Tag Tag where to move the bits
Destination
bit
DINT Immediate
(0-31 DINT)
(0-15 INT)
(0-7 SINT)
The number of the bit (lowest bit number) where
to start copying bits from the Source
Must be within the valid range for the Destination
data type
Length DINT Immediate (1-
32)
Number of bits to move