|
|
|
| Info | Support | Contact | About | ||
|
General Description
IntroductionThis FieldTalk Modbus® Slave Library - C++ Edition is a C++ class library which allows you to incorporate Modbus slave functionality into your device or application.Typical applications are supervisory control systems, data concentrators and gateways, user interfaces and factory information systems. Features:
Library StructureThe library is organised in two categories of classes.One category implements the Server Engines for each Modbus slave protocol flavour. There is one Server Engine class for each protocol flavour and a common Server Engine base class, which applies to all protocol flavours. Because the two serial protocols ASCII and RTU share some common code, an intermediate base class implements the functions specific to serial protocols.
The class MbusAsciiSlaveProtocol implements the Modbus ASCII protocol, the class MbusRtuSlaveProtocol implements the Modbus RTU protocol and the class MbusTcpSlaveProtocol implements the MODBUS/TCP protocol. Before a server can be used, a Data Provider has to be declared. A Data Provider is created by declaring a new class derived from MbusDataTableInterface. The class MbusDataTableInterface is the base class for a Data Provider and implements a set of default methods. An application specific Data Provider simply overrides selected default methods and the Modbus slave is ready.
class MyMbusDataTable: public MbusDataTableInterface { ... // Application specific data interface } dataTable; In order to use one of the three slave protocols, the desired protocol flavour class has to be instantiated and associated with the Data Provider:
MbusRtuSlaveProtocol mbusProtocol(&dataTable); After a protocol object has been declared and started up the server loop has to be executed cyclically. The Modbus slave is ready to accept connections and to reply to master queries.
while (1) { mbusProtocol.serverLoop(); } Overview
|
||||||||||||||||||||||||||||||||
| Back | Top of page | Info | Support | Contact | About | ||
|
Information in this document is subject to change without notice.
Copyright © 2000-2010 proconX Pty Ltd.
All rights reserved.
All product and brand names mentioned on this page may be trademarks or registered trademarks of their respective owners. |