Batch resets should never be twenty RST lines — range-reset instructions do it in one, and the same family covers batch zeroing and bulk transfer. The toolkit: ZRST (range reset), FMOV (fill) and BMOV (block move). With these three, batch device operations shrink by eighty percent. The sections below cover the instructions, the use cases, boundary discipline and error patterns.
| Instruction | Function | Example | Note |
|---|---|---|---|
| ZRST | Reset a whole range of bit or word devices | ZRST M100 M199 | Clears OFF/0 in one stroke |
| FMOV | Fill one value into consecutive points | FMOV D100 K0 K20 | D100 up 20 words all zeroed |
| BMOV | Block-to-block transfer | BMOV D100 D200 K10 | D100~D109 moved wholesale to D200 |
Division of labour: ZRST handles "clear OFF / clear 0" (handiest on bits); FMOV handles "fill one value" (zeroing or loading defaults on words); BMOV handles "move a whole block" (backup/restore of data areas, recipe loading).
① Mode-switch reset: switching auto→manual, ZRST all intermediate relays the auto flow used, so no stale state leaks into manual; ② step zeroing: on flow reset, ZRST the step-flag area + FMOV the step data; ③ data backup: BMOV the parameter area wholesale into a backup block, so failed edits can roll back; ④ recipe loading: BMOV from recipe area to working area; ⑤ alarm reset: ZRST the alarm flag area (only after confirming the sources are gone — otherwise the flags just relight).
Batch instructions are powerful, and one boundary error "clears a district". Three rules: ① ranges live in the partition table — the program-header comment lists every M/D zone, and both ZRST endpoints must fall inside one zone; ② never clear across functions ("while we're at it, clear D500~D599 too" — that is the comms area); ③ indexed ranges are clamped first (ZRST with index registers: clamp the index range, skip execution on overflow).
| Case | Correct | Wrong |
|---|---|---|
| Clear alarm flags M400~M449 | ZRST M400 M449 | ZRST M400 M499 (overshoots into the next zone) |
| Clear 10-word parameter scratch | FMOV D100 K0 K10 | FMOV D100 K0 K100 (wipes what follows) |
| Load 20-word recipe | BMOV D500 D0 K20 | Twenty MOV lines (verbose, error-prone) |
After a batch clear, load "initial values": FMOV zeroing then MOV to write default parameters (D100 = 500.0); ZRST flags then SET the necessary initial state bits. Bundle "clear + load defaults + set initial state" into one reset subroutine called by every return-to-initial path (power-up, mode switch, alarm recovery) — reset behaviour stays globally consistent. Scattered reset logic is the single biggest source of stale-state bugs.
| Symptom | Cause | Fix |
|---|---|---|
| An area silently goes all-zero | A ZRST/FMOV elsewhere overshoots its range | Cross-reference the clear instructions, tighten boundaries |
| Motion chaos after mode switch | Flow flags not cleared on switching | Call the unified reset subroutine at the switch |
| Comms area sporadically cleared | Batch zeroing swallowed the comms buffer | Re-verify the partition table, isolate comms |
| Accumulated counts vanish | FMOV fill length miscounted | Fixed K constants with comments |
| Machine lurches on reset | Flags cleared but enable not dropped first | Disable/stop outputs before resetting |
Batch instructions treat an address range as one object. Used well, reset logic fits on one screen; used carelessly, one overshooting ZRST evaporates half a program's state. The skill is not the instruction but the partition-table discipline — the table first, the ZRST second.
Instruction semantics and operand ranges follow the PLC's programming manual (Mitsubishi FX/Q, Delta, Xinje application-instruction chapters — ZRST/FMOV/BMOV are standard applied instructions); reset and stop safety follows GB 5226.1 / IEC 60204-1 — no batch reset may bypass the E-stop or safety interlocks.
One hard team rule: every ZRST/FMOV must reference the partition-table comment in the program header; a new zone updates the table before any instruction uses it.