• Libraries
  • Shop
  • Doc
  • Free Modbus
  • Support
  • Login
FieldTalk Modbus Slave C++ Library  Library version 2.10.0
  • Introduction
  • Chapters
  • Modules
  • Classes
Classes
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.

mbusslave_collab.png

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:

class MyDataProvider: public MbusDataTableInterface
{
public:
MyDataProvider() {}
// Override readHoldingRegistersTable method:
int readHoldingRegistersTable(int startRef, short regArr[], int refCnt)
{
... your application specific implementation
}
};
  • FieldTalk Modbus Slave C++ Library Library version 2.10.0
Speak to the Experts
Modbus Organization Member logo

We are member of the Modbus Organization, Inc.

Buy with Confidence
30-day money back guarantee All our FieldTalk web sales are backed by a 30-day Money Back Guarantee.
We Accept
Bank VISA MasterCard PayPal
Customer Info
  • Info & Contact
  • Customer Login
  • Terms of Service
  • Terms of Sale
  • Privacy Policy
© 2005-2025 proconX Pty Ltd. All rights reserved. proconX and FieldTalk are trademarks of proconX Pty Ltd.
All other trademarks and registered trademarks appearing on www.modbusdriver.com are the property of their respective owners.