Mask Write Register (Fc: 16H) - Mitsubishi Electric MELSEC iQ-R Series Reference Manual

Modbus and modbus/tcp
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

3.16

Mask Write Register (FC: 16H)

Operation description
Writes the masked value obtained by performing AND and OR operations on the value stored in one holding register area.
The value is written to the holding register as shown below.
Write value = (current value of target register  AND mask value)  (OR mask value  AND mask value)
If the OR mask value is 0000H, only the AND processing of the AND mask value will be performed.
If the AND mask value is 0000H, the OR mask value will be the write value.
Request message format (from master to slave)
Function code
Target holding register number
16H
(H)
Response message format (from slave to master)
■ When completed successfully
The slave returns the request message received from the master as-is.
■ When completed with an error
Function code
Data
Exception code
96H
With this function, the value stored in the holding register is read from the slave, the AND/OR processing is
performed on the master, and then the mask value is written to the holding register on the slave.
Therefore, if the holding register value is changed during AND/OR processing, the changed value will be
overwritten.
3 MODBUS STANDARD FUNCTION DETAILS
48
3.16 Mask Write Register (FC: 16H)
(0000H to FFFFH)
(L)
Data
AND mask value
(0000H to FFFFH)
(H)
(L)
OR mask value
(0000H to FFFFH)
(H)
(L)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents