306 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 7 Move/Logical Instructions (MOV, MVM, BTD, MVMT, BTDT, CLR, SWPB, AND, OR, XOR, NOT, BAND, BOR, BXOR, BNOT)
Bit Field Distribute with
Target (BTDT)
The BTDT instruction first copies the Target to the Destination. Then the instruction
copies the specified bits from the Source, shifts the bits to the appropriate position, and
writes the bits into the Destination. The Target and Source remain unchanged.
This instruction is available in relay ladder as BTD, see page 303
.
Operands:
Structured Text
Function Block
FBD_BIT_FIELD_DISTRIBUTE Structure
Variable Type Format Description
BTDT tag FBD_BIT_FIELD_DISTRIBUTE Structure BTDT structure
Operand Type Format Description
BTDT tag FBD_BIT_FIELD_DISTRIBUTE Structure BTDT structure
Input Parameter Data Type Description
EnableIn BOOL Function Block:
If cleared, the instruction does not execute and outputs are not updated.
If set, the instruction executes.
Default is set.
Structured Text:
No effect. The instruction executes.
Source DINT Input value containing the bits to move to Destination.
Valid = any integer
SourceBit DINT The bit position in Source (lowest bit number from where to start the move).
Valid = 0…31
Length DINT Number of bits to move.
Valid = 1…32
DestBit DINT The bit position in Dest (lowest bit number to start copying bits into).
Valid = 0…31
Target DINT Input value to move to Dest prior to moving bits from the Source.
Valid = any integer
Output Parameter Data Type Description
EnableOut BOOL The instruction produced a valid result.
Dest DINT Result of the bit move operation. Arithmetic status flags are set for this output.