MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › How does the BMOV instruction move data registers in blocks on Mitsubishi FX?
HomeModels
Table of contents

On this page

PLC & Programming (100 articles)

Quick Reference

  • PLC & Programming
  • Electrical & Electronic Basics (monthly)(每月更新中)
  • Electrical Control & Drawings (monthly)(每月更新中)
  • Drives & Actuators (monthly)(每月更新中)
  • Sensors & Detection (monthly)(每月更新中)
  • Industrial Communication & Networks (monthly)(每月更新中)
  • HMI & Host Systems (monthly)(每月更新中)
  • Industrial Robots & Motion Control (monthly)(每月更新中)
  • Mechatronic System Integration (monthly)(每月更新中)
  • Fault Diagnosis & Standards (monthly)(每月更新中)

How does the BMOV instruction move data registers in blocks on Mitsubishi FX?

BMOV (FNC 15) works in blocks: one instruction moves n consecutive points starting from a source device to n consecutive points starting from a destination device. It is far shorter than writing n separate MOV instructions, and it does not lose data when the source and destination overlap, which makes shifting a whole data area, inserting a value into the middle of it and switching parameter sets straightforward. Three things need settling first: how the count n is calculated, why overlapping is safe, and how BMOV divides the work with FMOV, FROM and TO.

One instruction moves a whole block

Data at the machine interface usually moves in groups: a recipe set is a dozen parameters, a process curve is dozens of points. Moving them one by one with MOV makes the program length proportional to the number of parameters, and adding a parameter means adding a rung. BMOV takes a head plus a length as its operands, so program length no longer depends on how many parameters there are — adding an item to the recipe means changing n. That is the practical value of the instruction.

Working out the count n

n is a count of data points, not bytes, and not twice the number of points. BMOV D0 D100 K10 moves ten words, D0 to D9, into D100 to D109. Where the source is a bit device, write it in digit form such as K1X0 or K2X0; each digit represents four bits, so two digits give a byte. When 32-bit values are moved with BMOV the count has to be taken in words: sixteen 32-bit values need 32 points, and halving that by mistake is easy. Writing n as 0 is not a valid operation.

Why an overlap does not lose data

If the points were copied one at a time from low number to high, and the destination sat above the source, the earlier source words would already have been overwritten and the later reads would return the wrong values. BMOV works out the direction of the overlap internally and copies from the end that cannot be overwritten, so an overlapping move is still correct. That is exactly what makes it useful for a whole-area shift or a mid-block insert: moving D10 to D99 into D11 to D100 shifts the block one place to the right. The two ranges must still stay inside valid device numbers; going out of range causes trouble as usual.

How BMOV divides the work with MOV, FMOV and DMOV

MOV moves a single word and is used for one-off assignments; DMOV moves 32 bits, that is, two words with the low word first; FMOV fills n points with one and the same value, which suits clearing or initialising; BMOV shifts a whole run of differing values. Combining them keeps the program short: FMOV clears the data area at power-up, BMOV switches parameter sets during operation, and MOV trims individual values afterwards.

Typical uses: recipe switching and module data

Once the recipe blocks are aligned to a fixed length, multiply the recipe number by that length, put the result in an index register, and one BMOV switches the whole parameter set — the usual arrangement on batching, packaging and printing machines that run several product formats. Talking to a module uses a different pair of instructions: FROM reads the module's buffer memory and TO writes it. Both also move several points at a time, but the path is between the PLC and the module, so they are not interchangeable with BMOV. At power-up, wait until the module is ready before reading calibration values into the data area.

Block transfer instructions compared

InstructionFunctionDirection and countTypical useWhere it goes wrong
MOVSingle-word transferSource to destination, 1 wordOne-off assignmentOnly half of a 32-bit value moves
DMOV32-bit transferSource to destination, 2 words32-bit counts and position valuesLow word first, easy to reverse
BMOVBlock transfern points from source head to destination headRecipe switching, moving a data blockn taken in bytes instead of words
BMOV with overlapSource and destination partly coincideDirection chosen automaticallyWhole-area shift, mid-block insertBoundary off by one when inserting
FMOVFill with one valueOne value into n pointsClearing an area, batch presetsRange too wide, parameters erased
DFMOVFill with one 32-bit valueOne 32-bit value into n pointsInitialising a 32-bit arrayConfusing points with words
FROMRead module buffer memoryModule to PLC, n pointsReading analog or positioning dataReading before the module is ready
TOWrite module buffer memoryPLC to module, n pointsWriting parameters and setpointsParameters written while running take no effect
BMOV with indexingHead follows the recipe numbern points from a movable headSwitching parameters between formatsOut-of-range index hits another area
Digit form K1X0Bit devices moved in groupsFour bits per digitReading DIP switches and panel inputsCounting in decimal doubles the points

Notes

BMOV itself takes scan time, and the larger the block the more it takes; moving several hundred points every scan visibly slows the cycle down. The usual answer is to gate it with a condition so it runs once when needed, or to keep it out of the fast path. A large power-up transfer is best done once, and outputs should stay inhibited until the whole block has arrived, so that no intermediate set of parameters ever takes part in control.

References

The function and operand types of data transfer instructions follow GB/T 15969.3 and the equivalent international standard IEC 61131-3 on assignment and transfer, with the point limits and bit-device notation as given in the Mitsubishi programming manual. Bus connection, protection and earthing between the PLC and its expansion modules follow GB 5226.1 and IEC 60204-1; the definition and range of module-side signals follow GB/T 15969.2 and IEC 61131-2.

Points to watch

⚠️ Three common traps:
(1) Taking n in bytes or doubling the point count, so the block is either too long or too short and the excess wipes out another parameter area;
(2) Running FMOV to clear an area with the range set too wide and erasing calibration values and recipe numbers that are only written at power-up, so every reading goes wrong afterwards;
(3) Relying on overlapping moves for an insert but misplacing the boundary by one point, so the data shifts by one place while the screen still looks correct and the logic is off throughout.

Before any large transfer, check the first and last device numbers at both ends and write the boundaries in the comments. Where the transfer has an intermediate state, hold the following actions with a completion bit until the whole block has landed. For position, recipe and calibration blocks, back up the original parameters first, and stop the machine, isolate it and prove dead before touching them.

Related reading

Related 3D models: Ready to build it? Download free 3D models & CAD drawings at MOULDL »
MOULDL · Electrical Knowledge Base · free self-study reference for electrical & automation engineers, 3D CAD models at MOULDL