Masked Move Calculator
Simulate PLC Masked Move (MVM) instructions bit-by-bit. Test hex masks (0F0Fh / 16#00FF), verify which Destination bits pass vs. hold prior state, and copy ready-to-use Structured Text code.
Destination (After MVM)
// 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)
Interactive Bit-Level MVM Visualizer (Click Any Bit to Toggle 0 ↔ 1)
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 HOLD | 0 HOLD | 0 HOLD | 1 HOLD | 0 PASS | 1 PASS | 0 PASS | 1 PASS | 0 HOLD | 0 HOLD | 1 HOLD | 1 HOLD | 0 PASS | 0 PASS | 1 PASS | 1 PASS |
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.
How the PLC Masked Move Instruction Works
Set Source & Word Width
Select 16-Bit INT (RSLogix 500 / MicroLogix) or 32-Bit DINT (Studio 5000 ControlLogix) and enter your Source word in hex, binary, or decimal.
Apply Your Hex Bit Mask
Enter a mask like 0F0Fh or click individual bits in the matrix. Bits set to 1 act as open gates; bits set to 0 block incoming data.
Verify Retained Destination Bits
Enter the Destination tag's prior value before the rung executes to confirm unrelated output coils or status flags remain untouched.
MVM Bitwise Formula Explained
Boolean Equation
Beginners often confuse MVM with a bitwise AND. While Dest := Source AND Mask clears every unmasked bit to zero, MVM ORs the masked source with Dest_Prior AND (NOT Mask). That makes MVM essential when writing a 4-bit BCD digit or 8-bit status byte into a shared 16-bit output word without shutting off active solenoids or motors on neighboring bits.
MVM 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) |
Frequently Asked Questions
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.