dm_modbus_read_int16 Function

public function dm_modbus_read_int16(modbus, address, value) result(rc)

Reads 2-byte signed integer from input or holding register, depending on the address, and returns result in value. If the address is not in input register or holding register range, it is interpreted as a holding register address.

The function returns the following error codes:

  • E_BOUNDS if argument n is larger than size of data.
  • E_INVALID if argument address 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=i2), intent(out) :: value

Value read from register.

Return Value integer


Calls

proc~~dm_modbus_read_int16~~CallsGraph proc~dm_modbus_read_int16 dm_modbus_read_int16 proc~dm_is_error dm_is_error proc~dm_modbus_read_int16->proc~dm_is_error proc~dm_modbus_read_input_registers dm_modbus_read_input_registers proc~dm_modbus_read_int16->proc~dm_modbus_read_input_registers proc~dm_modbus_read_registers dm_modbus_read_registers proc~dm_modbus_read_int16->proc~dm_modbus_read_registers modbus_read_input_registers modbus_read_input_registers proc~dm_modbus_read_input_registers->modbus_read_input_registers modbus_read_registers modbus_read_registers proc~dm_modbus_read_registers->modbus_read_registers

Called by

proc~~dm_modbus_read_int16~~CalledByGraph proc~dm_modbus_read_int16 dm_modbus_read_int16 proc~dm_modbus_read_uint16 dm_modbus_read_uint16 proc~dm_modbus_read_uint16->proc~dm_modbus_read_int16