write many bits
res = modbus_writeReg(mbc, addr, data) [res, ierr] = modbus_writeReg(mbc, addr, data)
The Modbus connection created with modbus_newTcp or modbus_newRtu.
The address on device where bits should be write from.
Double scalar to write considered as unsigned short.
The number of written bits. -1 if an error occured
Erreur number.
This function writes the status of holding registers from data
at the address
addr
of the remote device
The function uses the Modbus function code 0x10 (preset multiple registers).
When called with one output argument, a Scilab error will occur when the writing fails. When called with two output arguments, no Scilab error will occur but ierr
will contain the internal modbus error number.