FieldTalk Modbus® Slave Library
C++ Editions
FOCUS Software Engineering

Main Page | Modules | Class Hierarchy | Class List | Class Members | Related Pages

MbusSlaveServer Class Reference

Inheritance diagram for MbusSlaveServer:

Inheritance graph
Collaboration diagram for MbusSlaveServer:

Collaboration graph
List of all members.

Detailed Description

Base class which implements the Modbus® server engine.

This class realises the server engine. The server engines processes Modbus messages, parses the function codes and upon receipt of a valid master query it calls Data Provider methods to exchange data with the user application. For a more detailed description which Modbus data and control functions have been implemented in the server engine see section Server Functions common to all Protocol Flavours.

See also:
MbusSlaveServer

Server Functions common to all Protocol Flavours


Server Management Functions

int addDataTable (int slaveAddr, MbusDataTableInterface *dataTablePtr)
 Associates a protocol object with a Data Provider and a slave address.
virtual int serverLoop ()=0
 Modbus slave server loop.
virtual void shutdownServer ()
 Shuts down the Modbus Server.
virtual int isStarted ()=0
 Returns if server has been started up.
virtual int getConnectionStatus ()=0
 Associates a protocol object with a Data Provider and a slave address.

Protocol Configuration

long setTimeout (long timeOut)
 Configures master transmit time-out supervision.
long getTimeout ()
 Returns the master time-out supervision value.

Transmission Statistic Functions

unsigned long getTotalCounter ()
 Returns how often a message transfer has been executed.
void resetTotalCounter ()
 Resets total message transfer counter.
unsigned long getSuccessCounter ()
 Returns how often a message transfer was successful.
void resetSuccessCounter ()
 Resets successful message transfer counter.

Utility Functions

static char * getPackageVersion ()
 Returns the package version number.

Public Member Functions

virtual ~MbusSlaveServer ()
 Destructor.

Protected Member Functions

 MbusSlaveServer (MbusDataTableInterface *dataTablePtr=NULL)
 Constructs a MbusSlaveServer object and associates it with a Data Provider.

Constructor & Destructor Documentation

MbusSlaveServer MbusDataTableInterface dataTablePtr = NULL  )  [protected]
 

Constructs a MbusSlaveServer object and associates it with a Data Provider.

Parameters:
dataTablePtr Modbus data table pointer. Must point to a Data Provider object derived from the MbusDataTableInterface class. The Data Provider is the interface between your application data and the Modbus network.

~MbusSlaveServer  )  [virtual]
 

Destructor.

Shuts down server and releases any resources.