You are on page 1of 4

Menu

1 of 1

http://plcguide.mrplc.com/menu.shtml

Menu
Command Index
Basic Instructions
Timer & Counter
Compare
Data
Math
Register and Sequencer
Program Control
Communication
Programming References
Example Programs
PLC GuestBook
Links
Down Loads

Send Comments

2001-2006
All Rights Reserved
Your IP Address is: 117.222.1.67

02-07-2013 15:59

PLC Programming Command Guide Reference Web Site

1 of 3

http://plcguide.mrplc.com/data/mvm.html

Masked Move Instruction (MVM)


[Introduction Page] [Command Index] [Programming References]

The MVM instruction is a word instruction that moves data from a Source
location to a Destination location. The Masked Move instruction allows
portions of the Destination data to be masked by a separate word.

The symbol for the masked move command is illustrated above. The MVM command
is an instruction
placed on the right side of the rung. The MVM is similar to the MOV instruction in that it moves a copy of a
value from a Source to a desired Destination. Where the two instructions differ is that the MVM instruction
allows portions of the Source data to pass through a mask, which is a separate word, to the Destination address.
This instruction is carried out on each scan providing the rung conditions are true. The Source value is
unchanged by this command.
There are three parameters, Source, Mask, and Destination (Dest) associated with the masked move command:
Source is a constant or the address of a word (such as I:1, S:3, N7:0, B3:3, or T4:0.ACC) of the data you
want to move.
Mask is the address of a word (such as I:1, S:3, N7:0, B3:3, or T4:0.ACC) of the data through which the
Source data is filtered (See Note). The Mask value can be entered in as binary, decimal, or hexadecimal.
The value for the Mask will be displayed in hexadecimal. Conversions are made courtesy of
RSLogix500.
Dest is the operator specified address of a word (such as I:1, S:3, N7:0, B3:3, or T4:0.ACC) where the
data is to be move.
Note: The mask acts like a filter for the Destination address. The pattern of characters in the Mask determines
which Source bits will be passed through to the Destination address. The Mask acts like a logic AND
command. The bits in the Mask AND with the bits from the Source to determine the Destination address value.
The bits in the Mask that are reset to (0) do not pass data. Only the bits in the Mask that are set to (1) will pass
the Source data through. Preset bits in the Destination are not affected when the corresponding bits in the Mask
are reset to (0).
Addresses and values are assigned to the MVM command by positioning the cursor to the right of the Source
command location and then double clicking the left mouse button. This will open the Source text box allowing
the user to enter the Source address or constant. The same procedure is followed for the Mask and Dest
command locations. In the case of the Mask command a constant value is used, which is entered in either a
binary, octal, decimal, or hexidecimal format. The value for the Mask will be displayed in hexadecimal.
Conversions to hexidecimal are made courtesy of RSLogix500.

02-07-2013 15:59

PLC Programming Command Guide Reference Web Site

2 of 3

http://plcguide.mrplc.com/data/mvm.html

Programming Problem
Develop a program that when a button is pushed it latches a bit that will activate the MVM command. The
MVM then takes data stored in a source file and AND's that data with that in the Mask file. The MVM
command then places the value into a timer which will control an output for a specific amount of time. When
the timer is done, the bit is then unlatched.

This example shows that when a button is pushed, the binary bit B3:3/1 is latched. This bit then activates the
MVM command, which in this case moves the value of six into the preset of the timer T4:0. This timer keeps
the output O:2/2 on for six seconds. When the timer is done, the bit B3:3/1 is then unlatched.

02-07-2013 15:59

PLC Programming Command Guide Reference Web Site

3 of 3

http://plcguide.mrplc.com/data/mvm.html

The source file N7:0 contains the binary number (1 1 0), decimal 6. The MVM command AND's the word
address N7:0 with the data in the Mask file N7:1, which contains the binary value (1 1 1). The result of this
masked move places a 6 in the word address T4:0.PRE of the Timer.

[Back] [Next Command]

02-07-2013 15:59

You might also like