Writes many registers to address. The size of argument data
determines the number of registers to write, unless optional
argument n is passed. The function uses the Modbus function code
0x10 (preset multiple registers).
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 writing 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 write to. |
||
| integer(kind=u2), | intent(inout) | :: | data(:) |
Register values (unsigned). |
||
| integer, | intent(inout), | optional | :: | n |
Number of registers to write on input, number of registers written on output. |