Masked Move with Target (MVMT)

The MVMT instruction copies the Source to a Destination and allows portions of the data to be masked.
When enabled, the MVMT instruction uses a Mask to 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.
Entering an immediate mask value using an Input Reference
When you enter a mask, the programming software defaults to decimal values. If you want to enter a mask using another format, precede the value with the correct prefix.
Prefix
Description
16#
hexadecimal (e.g., 16#0F0F)
8#
octal (e.g., 8#16)
2#
binary (e.g., 2#00110011)
Available Languages
Ladder Diagram
This instruction is not available in Ladder Diagram.
Structured Text
MVMT(MVMT_tag);
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related faults.
Execution
Structured Text
Condition/State
Action Taken
Prescan
EnableIn and EnableOut bits are cleared to false.
Normal execution
EnableIn and EnableOut bits are set to true.
The instruction executes.
Postscan
EnableIn and EnableOut bits are cleared to false.
Examples
Step 1
The controller copies Target into Dest.
Step 2
The instruction masks Source and compares it to Dest. Any required changes are made in Dest, which becomes and input parameter to value_masked. Source and Target remain unchanged. A 0 in the mask restrains the instruction from comparing that bit.
Structured Text
MVMT_01.Source := value_1;
MVMT_01.Mask := mask_1;
MVMT_01.Target := target;
MVMT(MVMT_01);
value_masked := MVMT_01.Dest;
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal