General Description
The
FieldTalk Modbus Master C++ Library provides connectivity to Modbus slave compatible devices and applications.
Typical applications are Modbus based Supervisory Control and Data Acquisition Systems (SCADA), Modbus data concentrators, Modbus gateways, User Interfaces and Factory Information Systems (FIS).
Features:
- Robust design suitable for real-time and industrial applications
- Full implementation of Class 0 and Class 1 Modbus functions as well as a subset of the most commonly used Class 2 functions
- Standard Modbus boolean and 16-bit integer data types (coils, discretes & registers)
- Support for 32-bit integer, modulo-10000 and float data types
- Configurable word alignment for 32-bit types (big-endian, little-endian)
- Support of Broadcasting
- Failure and transmission counters
- Transmission and connection time-out supervision
- Detailed transmission and protocol failure reporting using error codes
- Scalable: you can use serial-line Modbus protocols only or MODBUS/TCP or all of them
The library is organised into one class for each Modbus protocol flavour and a common base class, which applies to all Modbus protocol flavours. Because the two serial-line protocols Modbus ASCII and Modbus RTU share some common code, an intermediate base class implements the functions specific to the serial protocols.
The base class MbusMasterFunctions contains all protocol unspecific functions, in particular the data and control functions defined by Modbus. All Modbus protocol flavours inherit from this base class.
The class MbusAsciiMasterProtocol implements the Modbus ASCII protocol, the class MbusRtuMasterProtocol implements the Modbus RTU protocol. The class MbusTcpMasterProtocol implements the MODBUS/TCP protocol and the class MbusRtuOverTcpMasterProtocol the Encapsulated Modbus RTU master protocol (also known as RTU over TCP or RTU/IP).
In order to use one of the three Modbus protocols, the desired protocol flavour class has to be instantiated:
After a protocol object has been declared and opened, data and control functions can be used: