SuperCom - MODBUS Server Protocol Library

Modbus Slave Functionality, Example

MODBUS is an industrial data communication protocol used to control PLC's and automation machines connected through serial lines (RS-232, RS-422, RS-485) or Ethernet TCP/IP connections.

Perform easily Modbus client or Modbus server device functionality in you application written for example with C++, C#, Delphi, Visual Basic (incl. NET), Java, Python, etc.

The SuperCom MODBUS Protocol Library provides a rock solid foundation to develop fast robust MODBUS capable applications. The SuperCom MODBUS Protocol Library hides the complex MODBUS protocol offering one easy to use set of functions that can communicate data packets over serial and TCP/IP connections thus saving valuable time, reducing costs and ensuring quality results.

Using the SuperCom MODBUS Protocol Library a Modbus server simulation is created with just a few code lines. A fast and short Modbus slave program that provides the functionality expected and required.

Library for MODBUS master and slave. MODBUS driver RTU and ASCII. Portable API for serial (RS-232, RS-485) communication or TCP/IP communication. Delphi modbus-library, C++ modbus, Java modbus library, C#, Visual Basic. Serial and TCP/IP Data Communications, Modbus protocol library, driver. One API for Serial communication or TCP/IP communication.

The SuperCom MODBUS Protocol Library supports data communication between devices connected to a serial port, on a bus system (RS-485) or ethernet network (TCP/IP). The protocol module supports ASCII and RTU (Remote Terminal Unit) operation mode (ASCII mode transfers ASCII codes and RTU binary data bytes in binary mode).

There is only one API to learn! The same functions and parameters with any type of connection supported by SuperCom (e.g. Serial, TCP/IP, Modem, TAPI, ISDN) and operation mode (Modbus ASCII, Modbus RTU, Modbus TCP).

The SuperCom MODBUS Protocol Library also supports custom function codes and data packets by implementing functions that communicate transparently. Controlling machine specific extensions is realy easy using these functions.

MODBUS Server Examples

The MODBUS Server (slave) receives the MODBUS requests, adjusts its internal states (internal MODBUS memory) according to the request and responds by transmitting the appropriate reply.

C, C++
// Install the Modbus Server

TcpServer = new CMyServer(szServerIP, SERVER_ID, ..);

// The Modbus Server is listen now and will report new
// clients via event (e.g. OnNewClient)

// Optional: monitor network events with OnPlug()

if ( TcpServer->IsTCPServerListen() ) InitPLCMemory();
 :

// new client, handle its requests
void CMyClient::PerformMBSlave(void)
{
   :
  while ( clCOM->Connected() == TRUE )
  {
     clCOM->PerformMBSlave();  // handle client requests
  }
}


  [ C/C++ ]    [ Delphi ]    [ C# ]

The above is a short example of a Modbus server device simulation. The product files contain different slave examples for different compiler e.g. C, C++, Delphi, C#, VB.NET.
Get the PDF document with more information and images of some of the included sample programs.

The above was a short introduction to the SuperCom Modbus server functionality. Please also visit the main information page. More.

 


MODBUS device simulation | MODBUS Server library | MODBUS RTU | MODBUS ASCII | MODBUS TCP | MODBUS over IP | MODBUS Serial Library | MODBUS RS-485 | MODBUS Server | MODBUS Server sample C, C++, C#, Pascal, Delphi, Java, Visual Basic, VBA | MODBUS C library | MODBUS C++ library | MODBUS Delphi library | MODBUS Pascal library | MODBUS VB library | MODBUS RTU Server example | MODBUS C Code Example


Home   Back

Info about ADONTEC
It Simply Works!

Updated on: 2023-06-21 09:51:43