Documentation
FieldTalk Modbus Master Library for .NET
MbusMasterFunctionsmaskWriteRegister Method |
Modbus function 22 (16 hex), Mask Write Register.
Namespace: FieldTalk.Modbus.Master
Assembly: FieldTalk.Modbus.Master (in FieldTalk.Modbus.Master.dll) Version: 2.15.2-eval+3d8362b4bb861c05760d48b11d303e954bb8597c
Parameters
- slaveAddr
- Type: SystemInt32
Modbus address of slave device or unit identifier (Range: 1 - 255) - regAddr
- Type: SystemInt32
Register address (Range: 1 - 65536) - andMask
- Type: SystemInt16
Mask to be applied as a logic AND to the register - orMask
- Type: SystemInt16
Mask to be applied as a logic OR to the register
Return Value
Type: Int32BusProtocolErrors.FTALK_SUCCESS on success or error code. See BusProtocolErrors for possible error codes.
Masks bits according to an AND and an OR mask into a single output register
(holding register, 4:00000 reference). Masking is done as follows:
retVal = (currentVal AND andMask) OR (orMask AND (NOT andMask))
| No broadcast supported |