Architecture

 

tcpmodbus depends on the following libraries :

  • the boost C++ libraries
  • the cppunit C++ libraries (only for compiling the unit tests)

To build the library using the included build scripts you need scons which can be invoked with a debug=1 argument or without

Server

 

to implement a server

#include "modbus/server.h" 

class Registers : public ModbusRegisters
{
	//implement the registers supporting the ModbusRegisters interface
	//probably with a mutex as the server runs on a different thread
};

Registers regs;		//create a instance of the registers class

ModbusServer s(ModbusDefaultPort,regs);	//instanciate the server,
						//passing the port and the registers to use
					

Client

 

to implement a client

Messages are implemented in protocol.h. 
//A client interface is not implemented yet.
					

Source

 

to get source

svn co https://tcpmodbus.svn.sourceforge.net/svnroot/tcpmodbus tcpmodbus