Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 297
Move/Logical Instructions (MOV, MVM, BTD, MVMT, BTDT, CLR, SWPB, AND, OR, XOR, NOT, BAND, BOR, BXOR, BNOT) Chapter 7
Masked Move (MVM)
The MVM instruction copies the Source to a Destination and allows portions of the data
to be masked.
This instruction is available in structured text and function block as MVMT, see
page 300
.
Operands:
Relay Ladder
Structured Text
This instruction is available in structured text as MVMT. Or you can combine bitwise
logic within an expression and assign the result to the destination. This expression
performs a masked move on Source.
See Structured Text Programming
for information on the syntax of expressions and
assignments within structured text.
Description: The MVM instruction uses a Mask to either pass or block Source data bits. A ‘1’ in the
mask means the data bit is passed. A ‘0’ in the mask means the data bit is blocked.
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.
Operand Type Format Description
Source SINT
INT
DINT
Immediate
Tag
Value to move
A SINT or INT tag converts to a DINT value by zero-fill.
Mask SINT
INT
DINT
Immediate
Tag
Which bits to block or pass
A SINT or INT tag converts to a DINT value by zero-fill.
Destination SINT
INT
DINT
Tag Tag to store the result
dest := (Dest AND NOT (Mask))
OR (Source AND Mask);