Public Member Functions | List of all members
prbt_hardware_support::ModbusClient Class Referenceabstract

#include <modbus_client.h>

Inheritance diagram for prbt_hardware_support::ModbusClient:
Inheritance graph

Public Member Functions

virtual unsigned long getResponseTimeoutInMs ()=0
 Get the response timeout. More...
virtual bool init (const char *ip, unsigned int port)=0
 Initialize the modbus client by connecting to the server. More...
virtual RegCont readHoldingRegister (int addr, int nb)=0
 Read the holding registers. More...
virtual void setResponseTimeoutInMs (unsigned long timeout_ms)=0
 Set the response timeout. More...
virtual RegCont writeReadHoldingRegister (const int write_addr, const RegCont &write_reg, const int read_addr, const int read_nb)=0
virtual ~ModbusClient ()=default

Detailed Description

Definition at line 28 of file modbus_client.h.

Constructor & Destructor Documentation

◆ ~ModbusClient()

virtual prbt_hardware_support::ModbusClient::~ModbusClient ( )

Member Function Documentation

◆ getResponseTimeoutInMs()

virtual unsigned long prbt_hardware_support::ModbusClient::getResponseTimeoutInMs ( )
pure virtual

Get the response timeout.

response timeout

Implemented in prbt_hardware_support::LibModbusClient.

◆ init()

virtual bool prbt_hardware_support::ModbusClient::init ( const char *  ip,
unsigned int  port 
pure virtual

Initialize the modbus client by connecting to the server.

ipof the server
portto use
true if the connection to the server succeeded
false if the connection to the server failed

Implemented in prbt_hardware_support::LibModbusClient.

◆ readHoldingRegister()

virtual RegCont prbt_hardware_support::ModbusClient::readHoldingRegister ( int  addr,
int  nb 
pure virtual

Read the holding registers.

addrstarting address to read from
nbnumber of registers to read
ModbusExceptionDisconnectif a disconnect from the server happens
the registers content.

Implemented in prbt_hardware_support::LibModbusClient.

◆ setResponseTimeoutInMs()

virtual void prbt_hardware_support::ModbusClient::setResponseTimeoutInMs ( unsigned long  timeout_ms)
pure virtual

Set the response timeout.

Interval to wait for a response from the server if within this timespan no answer is received readHoldingRegisters will throw a ModbusExceptionDisconnect

timeout_msin ms

Implemented in prbt_hardware_support::LibModbusClient.

◆ writeReadHoldingRegister()

virtual RegCont prbt_hardware_support::ModbusClient::writeReadHoldingRegister ( const int  write_addr,
const RegCont write_reg,
const int  read_addr,
const int  read_nb 
pure virtual

The documentation for this class was generated from the following file:

autogenerated on Wed Nov 25 2020 03:10:38