Chapter 6. Serial I/O, SNP & RTU Protocols248 PACSystems* RX7i, RX3i and RSTi-EP CPU Reference Manual GFK-2222ADMessage (22): Mask Write 4x MemoryModifies the contents of a specified 4x register using a combination of an AND mask, an OR mask, andthe 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 tobe used as the OR mask.The function's algorithm is:Result = (Current Contents AND And_Mask) OR (Or_Mask AND And_Mask)For example:Hex BinaryCurrent Contents 12 0001 0010And_Mask F2 1111 0010Or_Mask 25 0010 0101And_Mask 0D 0000 1101Result 17 0001 0111Note: If the Or_Mask value is zero, the result is simply the logical ANDing of the current contentsand 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 (functioncode 03). They could, however, be changed subsequently as the controller scans its user logicprogram.Example of a Mask Write to register 5 in slave device 17, using the above mask values:Field Name Example(Hex)Slave Address 11Function 16Reference Address Hi 00Reference Address Lo 04And_Mask Hi 00And_Mask Lo F2Or_Mask Hi 00Or_Mask Lo 25Error Check (LRC or CRC) --Response:The normal response is an echo of the query. The response is returned after the register has beenwritten.