Documentation
|
FieldTalk Modbus Slave C++ Library
Library version 2.11.0
|
Data Provider
Classes | |
| interface | MbusDataTableInterface |
| This class defines the interface between a Modbus slave Server Engine and your application. More... | |
Detailed Description
A Data Provider acts as an agent between your Application and the Server Engine.
After instantiating a Server Engine class of any protocol flavour, you have to associate it with a Data Provider by calling addDataTable and passing a pointer to the Data Provider object.
MbusRtuSlaveProtocol mbusProtocol;
mbusProtocol.addDataTable(1, &dataTable);
To create an application specific Data Provider derive a new class from MbusDataTableInterface and override the required data access methods.
A minimal Data Provider which realises a Modbus slave with read access to holding registers would be:
{
public:
MyDataProvider() {}
// Override readHoldingRegistersTable method:
{
... your application specific implementation
}
};