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

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

SuperCom - MODBUS Protocol Module

Communication Solutions by ADONTEC
Some SuperCom MODBUS Functions

MODBUS Protocol Module

The SuperCom MODBUS Protocol Module supports data communication between devices connected on a bus system or network. The current implementation supports Asynchronous serial communications (RS-232, RS-422/485) and TCP/IP communications. The protocol module supports ASCII and RTU* operation mode. ASCI mode transfer ASCII codes and RTU binary data bytes (binary mode).
*Modbus Remote Terminal Unit

MODBUS Protocol Serial Communication Library Modbus protocol

The SuperCom MODBUS Protocol Module hides the protocol details and enables data communication with ease.

The SuperCom MODBUS Protocol Module provides a well tested library to develop fast and easy a MODBUS capable application around it. It saves valuable time of reading, understanding and implementing this protocol. It also supports custom function codes and data packets by implementing functions that communicate transparently.

It uses the SuperCom Communication Layer which provides a rock solid foundation to develop data communication software fast and without headache.

Sample MODBUS Protocol API:

Read a single coil

#define SLAVE_ID  1

BYTE Com = COM_2;

   ComInit (Com);
   ComSetState (Com, 9600, 8, 1, 'E', SIGNAL_NONE);

   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);


Read/Write Registers


#define SLAVE_ID  1

WORD Buffer [10];
WORD wStart=0x0000;
WORD wCount=1;
WORD wValue=0x0020;

BYTE Com = COM_2;

   ComInit (Com);
   ComSetState (Com, 9600, 8, 1, 'N', SIGNAL_NONE);
     :
     :
   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))
   {
       int i;

       printf("Read %d Register:", wCount);

       for (i=0; i<wCount; i++)
          printf ("%4X",Buffer[i]);
   }
   else
       printf ("Error: %d\n", RS_MBGetLastError(Com));                          

   ComReset (Com);

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

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


How to use?
The SuperCom MODBUS Protocol Module can be used over any communication link supported by the owned SuperCom product (SuperCom Communication Layer, currently Serial, TCP/IP, ISDN). The SuperCom Communication Layer can be any SuperCom software that includes a DUAL API or DLL API.

For example: Serial Communications (RS-232/422/485) one can use the SuperCom RS-232 for Windows or SuperCom 3964 Protocol Engine. For TCP/IP Communications use the SuperCom for TCP/IP. For combined Serial and TCP/IP Communications use the SuperCom Suite or SuperCom Suite Industrial.

How to get?
Customers of a latest SuperCom Communication Layer receive (on request) the MODBUS Protocol Module Free of charge! Please send eMail incl. Serial Number.


Home    Back
Modified at:

ADONTEC