read many bits
res = modbus_readBits(mbc, addr, nb) [res, ierr] = modbus_readBits(mbc, addr, nb)
The Modbus connection created with modbus_newTcp or modbus_newRtu.
The address on device where bits should be read from.
The number of bits that should be read.
A double matrix (size 1 x nb) with coils values. An empty matrix in case of error when called with two output arguments.
Erreur number.
This function reads the status of the nb
bits (coils) to
the address addr
of the remote device through mbc
connection
descriptor.
The function uses the Modbus function code 0x01 (read coil status).
When called with one output argument, a Scilab error will occur when the reading fails. When called with two output arguments, no Scilab error will occur but ierr
will contain the internal modbus error number.