Treating a block of bit devices (32 states like M100~M131, a row of cylinder flags, a bank of outputs) as one whole beats writing dozens of MOV lines. Three tools do the work: BMOV moves bit blocks wholesale, FMOV fills blocks with one value, and combined addressing (KnX) treats bit groups as words. Master them and snapshot/restore, grouped outputs and grouped inputs each become a couple of instructions. The sections below cover the three methods, use cases and pitfalls.
BMOV transfers between bit ranges and word areas: read 16 points from M100 into one D (BMOV M100 D0 K1), or expand one D onto Y0's 16 points (BMOV D0 Y0 K1). Typical uses:
| Use | Coding | Note |
|---|---|---|
| State snapshot | BMOV M100 D10 K4 | 128 intermediates photographed into D area |
| Snapshot restore | BMOV D10 M100 K4 | Moved back for rollback |
| Grouped output | BMOV D20 Y40 K2 | 32 outputs refreshed as words |
| Grouped acquisition | BMOV X40 D30 K2 | 32 inputs read in as words |
Tip: start bit blocks on 16-point boundaries — arbitrary starting points make "which bit sits in which word" mental arithmetic nobody enjoys; aligned starts halve the debugging.
FMOV writes one value to many targets: FMOV M200 K0 K4 (M200 up, 64 points all OFF), FMOV D50 K0 K10 (10 words zeroed). Grouped resets prefer FMOV/ZRST over repeated RST lines. Note that fills into bit areas only make sense for 0 and all-ones (all OFF / all ON) — "filling 0x1234 into a bit area" is meaningless.
K4Y0 denotes Y0 up, four nibbles, 16 points as one word: MOV K4Y0 D0 reads the 16 outputs into D0; MOV D1 K2Y20 writes 8 outputs as a word. This is the most direct form of batch bit operation: output banks, lamp banks and valve banks refresh as words — one line replaces sixteen.
| Expression | Meaning | Typical use |
|---|---|---|
| K2X20 | X20 up, 8 points as a byte | Reading a DIP switch bank whole |
| K4Y0 | Y0 up, 16 points as a word | Refreshing an output bank whole |
| K8M100 | M100 up, 32 points as a double word | Snapshotting a large state group |
The danger of batch writes is overwriting: among Y40's 16 points, some bits may be driven by other logic, and a whole-word MOV brushes them away. Rules: ① the batch-write block must be an exclusively-owned block — those 16 points answer only to the batch refresher, confirmed in the partition table; ② mixed-driven blocks use bit arithmetic: new = old AND keep-mask OR update-mask, touching only the intended bits; ③ after a batch write, the output summary runs once more so next scan cannot brush it back.
| Symptom | Cause | Fix |
|---|---|---|
| Individual outputs flicker off | Batch write fighting single-point drivers (double drive) | Exclusive block or masked merge |
| Restore lands skewed | Snapshot and restore ranges differ in start or length | Snapshot/restore share the same parameters |
| Input group reads all zero | Combined addressing start wrong (K2X20 typed as K2X2) | Verify starts on 8/16 boundaries |
| Weird values filled into bits | Non-0/non-ones fill into a bit area | Bit areas take 0 or all-ones only |
| Batch reset misses points | ZRST/FMOV length undercounted | Check lengths against the partition table |
Batch bit operation means "see the bit block as a word block": once a bit group has whole-block semantics (a valve bank, a lamp row, a snapshot segment), operate on it with word instructions; bits with individual semantics stay bit-level. Knowing which groups are "wholes" and which are "individuals" settles the boundaries naturally.
BMOV/FMOV and combined addressing (KnX/Y/M/D) syntax follow the PLC's programming manual applied-instruction chapters (Mitsubishi, Delta, Xinje all provide equivalents); double-drive conflicts resolve per the output-summary principle, and safety outputs still pass the unified safety stage per GB 5226.1 / IEC 60204-1 — no batch write bypasses the safety interlocks.
Make it a rule: any "grouped" bit block starts on a 16 boundary, is exclusively owned, and appears in the partition table. All three, and batch operations are a code-saver.