dm_modbus_read_bits Function

public function dm_modbus_read_bits(modbus, address, data, n) result(rc)

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.

Arguments

Type IntentOptional 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.

Return Value integer


Calls

proc~~dm_modbus_read_bits~~CallsGraph proc~dm_modbus_read_bits dm_modbus_read_bits modbus_read_bits modbus_read_bits proc~dm_modbus_read_bits->modbus_read_bits