maskWrite
R2026bPerform mask write operation on a holding register
Syntax
Description
maskWrite(
sets or clears individual bits in a holding register at a specified
modbusClientObj,address,andMask,orMask)address on the Modbus server connected to the client
specified by modbusClientObj. The function performs a
read-modify-write operation using a combination of andMask,
orMask, and the current contents of the register.
The function computes the new register value as:
newRegisterVal = (registerVal & andMask) | (orMask & ~andMask)
orMask value is 0, the new register value
is registerVal & andMask. If the andMask
value is 0, the new register value is equal to the
orMask value.