: data = maskWrite (dev, address, andmask, ormask)
: data = maskWrite (dev, address, andmask, ormask, serverid)

Read holding register at address from modbus device dev apply masking and write the change data.

writeregister value = (readregister value AND andMask) OR (orMask AND (NOT andMask))

Inputs

dev - connected modbus device

address - address to read from.

andmask - AND mask to apply to the register

ormask - OR mask to apply to the register

serverId - address to send to (0-247). Default of 1 is used if not specified.

Outputs

data - data read from the device

See also: modbus.

Package: instrument-control