Data transmission using MODBUS Protocol Driver. Serial Communications and via TCP/IP. MODBUS RTU ASCII Modus. Modbus Library with Master, Client and Slave support.

Serial Communications and via TCP/IP. MODBUS RTU ASCII Modus. Data transmission using MODBUS Protocol. Modbus Library.

SuperCom - MODBUS Protocol Library

Communication Solutions by ADONTEC
Some SuperCom MODBUS Functions
64 Bit Ready32 Bit and 64 Bit Versions available!

MODBUS Protocol Library

MODBUS is a industrial data communication protocol to be used over serial lines (serial communications protocol) and over TCP/IP connections.

The SuperCom MODBUS Protocol Library provides a rock solid foundation to develop fast and easy MODBUS capable applications. It hides the complex protocol details and enables data communication with ease thus saving valuable time, reducing costs and ensuring quality results.

MODBUS Protocol Serial Communication Library Modbus protocol

The SuperCom MODBUS Protocol Library supports data communication between devices connected to a serial port, on a bus system or network. The protocol module supports ASCII and RTU (Remote Terminal Unit) operation mode (ASCI 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 serial, TCP/IP or ISDN type of connections and operation mode (MODBUS/ASCII, MODBUS/RTU).

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

Accomplish with ease
In most cases only a handful functions are needed to talk to the PLC. Your project is updated real fast. A lot of functions is backing you up to accomplish different tasks or configurations.

The SuperCom MODBUS Protocol Library uses the SuperCom Communication Layer which provides a rock solid foundation to develop data communication software fast and without headache. Thus it makes no difference to the programmer if the MODBUS protocol used over TCP/IP or serial lines (RS-232, RS-422, RS-485, Modem, TAPI).

Samples - MODBUS Protocol API:

1. Read a single coil

C/C++

   #define SLAVE_ID  1
   BYTE Com = COM_2; // Use serial port COM2

   ComInit (Com);
   ComSetState (Com, 9600, ...);
     :

   RS_MBSetConfig(Com,,SuperCom.MODBUS.MODBUS_MODE_RTU,,);

   if (RS_MBReadCoil (Com,
                      SLAVE_ID,
                      wCoil,
                      &Buffer))
   {
       printf("Coil[%d] = %s ", wCoil, Buffer?"TRUE":"FALSE");
   }
   else
   {
       int ErrorCode = RS_MBGetLastError(Com);

       if (ErrorCode == MB_ERR_EXCEPTION)
           printf("Exception %02X reported from slave ", RS_MBGetException(Com));
       else
           printf("Error %d", ErrorCode);
   }

   ComReset (Com);
  C/C++    C#    Delphi    Visual Basic

 

2. Read/Write Registers

C/C++

   #define SLAVE_ID  1
   BYTE Com = COM_2; // Using serial port COM2

   WORD Buffer [10];
   WORD wStart=0x0000;
   WORD wCount=1;
   WORD wValue=0x0020;
        :
   ComInit (Com);
   ComSetState (Com, 9600, ...);
        :
   RS_MBSetConfig(Com,,SuperCom.MODBUS.MODBUS_MODE_RTU,,);

   if (RS_MBWriteRegister(Com, SLAVE_ID, wStart, wValue))
       printf ("Read Success.\n");
   else
       printf ("Error: %d\n", RS_MBGetLastError(Com));

   if (RS_MBReadHoldingRegisters(Com,
                              SLAVE_ID,
                              wStart,
                              &wCount,
                              Buffer))
   {
       printf("Read %d Register:", wCount);
       for (int i=0; i<wCount; i++)  printf ("%4X",Buffer[i]);
   }
   else
       printf ("Error: %d\n", RS_MBGetLastError(Com));

   ComReset (Com);
  C/C++    C#    Delphi    Visual Basic

 

Capture, Store, Forward - MODBUS Slave or Gateway functions
Communication at lower data packet level is possible thus allowing to capture, store and forward of MODBUS data packets or transmit replies. Monitoring MODBUS data packets, simulating a MODBUS Slave or building a protocol converter / gateway is possible. Simulating a MODBUS Slave can be very handy while testing the software.

License Information
Executables developed using SuperCom MODBUS Protocol Module can be distributed royalty free.

Supported compilers
C++, C#, Delphi, Visual C++, Visual Basic, Visual Basic NET, C++ Builder, Borland C/C++, Microsoft C/C++, Borland Pascal, VBA, LabView, PowerBuilder and other Windows programming tools (MS .NET ?).

Samples
for C/C++, C#, Visual C++, C++ Builder, Pascal/Delphi, Visual Basic, Visual Basic NET (VB .NET), LabVIEW.

How to use?
The SuperCom MODBUS Protocol library can be used over any communication link supported by SuperCom (currently Serial, TCP/IP, ISDN). For a list of available SuperCom packages incl. support for MODBUS see the following chart.

The use of one common API for Serial, TCP/IP and ISDN applies here too.


Home    Back
Modified at:

ADONTEC