Masked Move Calculator (PLC MVM Instruction)
Use this free Masked Move Calculator to simulate 16-bit INT and 32-bit DINT PLC MVM instructions bit-by-bit, test hexadecimal masks (0F0Fh / 16#00FF), and verify retained Destination bits before downloading to a live controller.
// Studio 5000 Structured Text Equivalent (16-Bit INT) Dest_Tag := (Source_Tag AND 16#0F0F) OR (Dest_Tag AND (NOT 16#0F0F)); // Result: Dest_Tag = 16#1533 (Signed: 5427)
Green (Mask = 1) passes the Source bit through; Amber (Mask = 0) blocks Source and holds the Destination's prior bit.
| Register | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Source | ||||||||||||||||
| Mask | ||||||||||||||||
| Dest (Prior) | ||||||||||||||||
| Dest (After) | 0 H | 0 H | 0 H | 1 H | 0 P | 1 P | 0 P | 1 P | 0 H | 0 H | 1 H | 1 H | 0 P | 0 P | 1 P | 1 P |
How the PLC Masked Move Instruction Works
Select Word Size & Source
Choose 16-Bit INT for RSLogix 500 / MicroLogix registers (such as N7:0 or I:1.0) or 32-Bit DINT for Studio 5000 ControlLogix tags, then enter your incoming Source value in hex, binary, or decimal.
Configure the Bitwise Mask
Type a hex mask like 00FFh or click individual bit cells in the interactive matrix. Every mask bit set to 1 passes the corresponding Source bit through; every bit set to 0 blocks it.
Verify Prior Destination State
Enter the Destination register's prior value before scan execution to confirm adjacent solenoid coils, indicator lamps, or status bits on unmasked positions remain completely unchanged.
MVM Bitwise Formula & Truth Table
Boolean Equation vs. Bitwise AND
Controls engineers frequently compare MVM against a bitwise AND instruction. Executing Dest := Source AND Mask zeroes out every bit where Mask = 0. By contrast, MVM ORs the masked Source bits with Dest_Prior AND (NOT Mask), preserving prior Destination states on blocked bits. That makes MVM indispensable when updating a 4-bit BCD display digit or an 8-bit valve bank group inside a shared 16-bit output card word without dropping energized motors on neighboring bits.
Bit-Level Truth Table
| Mask Bit | Source Bit | Dest (Prior) | Dest (After) | Action |
|---|---|---|---|---|
| 0 | 0 or 1 | 0 | 0 | Hold Prior (0) |
| 0 | 0 or 1 | 1 | 1 | Hold Prior (1) |
| 1 | 0 | 0 or 1 | 0 | Pass Source (0) |
| 1 | 1 | 0 or 1 | 1 | Pass Source (1) |
Masked Move Instruction FAQ
What does the Masked Move (MVM) instruction do in a PLC?+
The Masked Move (MVM) instruction copies data from a Source register to a Destination register through a bitwise Mask. Wherever a Mask bit is 1, the corresponding Source bit overwrites the Destination bit. Wherever a Mask bit is 0, the Destination bit retains its existing value prior to the instruction.
How is Masked Move (MVM) different from a bitwise AND instruction?+
A bitwise AND instruction forces all unmasked (0) positions in the Destination register to become 0. In contrast, Masked Move (MVM) preserves the previous state of unmasked bits in the Destination register using the logic: Dest_After = (Source & Mask) | (Dest_Before & ~Mask). This prevents accidentally turning off unrelated outputs sharing the same 16-bit output card.
How do I format hexadecimal masks in Studio 5000 vs. RSLogix 500?+
In Allen-Bradley Studio 5000 Logix Designer (ControlLogix / CompactLogix), hexadecimal constants use the 16# prefix, such as 16#0F0F or 16#00FF_00FF. In legacy RSLogix 500 (SLC 500 / MicroLogix), hexadecimal masks use a trailing h suffix (such as 0F0Fh), and masks beginning with A–F require a leading zero (e.g., 0FF00h).
Does MVM use 16-bit INT or 32-bit DINT data types?+
RSLogix 500 operates primarily on 16-bit signed integers (INT, bits 0–15). Studio 5000 natively executes on 32-bit signed double integers (DINT, bits 0–31) as well as SINT (8-bit) and INT (16-bit) tags. Make sure Source, Mask, and Destination share matching data types to avoid implicit sign-extension.
Why does my PLC show a negative decimal number after a Masked Move?+
PLC INT (16-bit) and DINT (32-bit) registers use signed two’s complement representation. If the Most Significant Bit (Bit 15 for INT, or Bit 31 for DINT) is 1 after the Masked Move completes, the PLC displays the decimal value as negative even though the underlying bit pattern is exact.
Are my register values stored on a server?+
No. All bitwise calculations execute 100% locally in your web browser. Your latest register values are cached in browser localStorage for convenience, and shareable links encode the hex values directly in URL query parameters.
Complete PLC & Industrial Automation Calculator Suite
Bitwise & Data Formats
Simulate 16-bit INT and 32-bit DINT Masked Move instructions bit-by-bit with clickable mask gates and Structured Text output.
Decode or encode two 16-bit Holding Registers across all 4 endian byte orders (ABCD, CDAB, BADC, DCBA) for 32-bit REAL floats.
Convert between 16/32-bit Binary-Coded Decimal (BCD) thumbwheel words and integer values with invalid A–F nibble fault detection.
Analog I/O & Sensors
Convert raw ADC counts (4000–20000, 6241–31206, 0–27648) and 4–20 mA signals into engineering units with 5-point calibration tables.
Bidirectional Callendar–Van Dusen (°C/°F ↔ Ohms) calculator for PT100 and PT1000 RTDs with Class AA, A, and B tolerance bands.
Convert thermocouple millivolt (mV) readings to process temperature and back with live Cold Junction Compensation (CJC).
Estimate cabinet temperature rise, conductive heat transfer, required cooling fan airflow (CFM), and AC capacity (BTU/hr) for enclosures.
Fieldbus, Motion & Control
Compute polynomial 0xA001 CRC-16 checksums in Little-Endian Lo-Byte / Hi-Byte wire order and validate captured RS-485 frames.
Calculate maximum RS-485 trunk length, Modbus RTU 3.5-character silent interval (t3.5), frame duration, and max polling rate.
Compute synchronous speed, motor slip %, output shaft RPM after gearbox reduction, and target VFD command frequency in Hz.
Verify PLC High-Speed Counter (HSC) kHz input limits from encoder PPR, 1x/2x/4x quadrature decoding, shaft RPM, and linear travel.
Convert Independent (Kp, Ki, Kd) vs. ISA Dependent (Kc, Ti, Td) PID gains and compute FOPDT / Ultimate Gain starting parameters.