Reads many input bits from address
. The size of argument data
determines the number of bits to read, unless optional argument
n
is passed. The function uses the Modbus function code 0x01
(read coil status).
The function returns the following error codes:
E_BOUNDS
if argument n
is larger than size of data
.E_INVALID
if argument data
is invalid.E_MODBUS
if reading the registers failed.E_NULL
if the Modbus context is not associated.Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(modbus_type), | intent(inout) | :: | modbus |
Modbus RTU/TCP type. |
||
integer, | intent(in) | :: | address |
Address to read from. |
||
integer(kind=u1), | intent(inout) | :: | data(:) |
Bits. |
||
integer, | intent(inout), | optional | :: | n |
Number of registers to read on input, number of registers read on output. |