Function CodesModbus Term
FC22 — Mask Write Register
Modify specific bits of a holding register without changing others.
Definition
Function Code 22 performs a bitwise AND and OR on a register value — letting you set, clear, or preserve individual bits atomically. The slave computes: Result = (CurrentValue AND AndMask) OR (OrMask AND NOT AndMask). This is useful for setting or clearing individual bits in a configuration register without disrupting adjacent bits.
Quick Facts
Related Terms
Was this definition helpful?