Masked Move Instructions for Allen-Bradley SLC 500 PLC's
Masked Move Instruction (MVM)

[Command Table] [Main Course Page] [Group Index]

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 AB button for 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:

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.

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.

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.

[Command Table] [Main Course Page] [Group Index]