Reads 2-byte unsigned integer from input or holding register,
depending on the address, and returns result in value
. Stores the
2-byte unsigned value in a 4-byte signed integer.
The function returns the following error codes:
E_BOUNDS
if argument n
is larger than size of data
.E_INVALID
if argument address
or 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=i4), | intent(out) | :: | value |
Value read from register. |