Chapter 6. Serial I/O, SNP & RTU Protocols
248 PACSystems* RX7i, RX3i and RSTi-EP CPU Reference Manual GFK-2222AD
Message (22): Mask Write 4x Memory
Modifies the contents of a specified 4x register using a combination of an AND mask, an OR mask, and
the register's current contents. The function can be used to set or clear individual bits in the register.
Broadcast is not supported.
Query:
The query specifies the 4x reference to be written, the data to be used as the AND mask, and the data to
be used as the OR mask.
The function's algorithm is:
Result = (Current Contents AND And_Mask) OR (Or_Mask AND And_Mask)
For example:
Note: If the Or_Mask value is zero, the result is simply the logical ANDing of the current contents
and And_Mask. If the And_Mask value is zero, the result is equal to the Or_Mask value.
Note: The contents of the register can be read with the Read Holding Registers function (function
code 03). They could, however, be changed subsequently as the controller scans its user logic
program.
Example of a Mask Write to register 5 in slave device 17, using the above mask values: