Modbus TCP to Proprietary Protocol Conversion

R

Thread Starter

ramana

1) I have to convert standard MODBUS TCP packets/requests to a proprietary protocol using a gateway sort of device having an IP address. The proprietary protocol devices are connected to this gateway with a serial line sub-network. Also the same gateway is required to convert the responses from the proprietary devices to MODBUS TCP.

How shall i go about that?. Any ideas?.

2) What will be the value of UNIT IDENTIFIER if more than 1 MODBUS slave ( server) is directly connected to ethernet with a network interface.

I understood from one of the documents that, it is 0xFF for all of them. Is it correct?.

3) How to configure the proprietary protocol devices in MODBUS MASTER (client) so that it can send quieries to the respective devices.

4)If 2 such gateways are there ( with one MODBUS TCP master) then - the value of UNIT IDENTIFIER shall be unique across gateways or not.
 
S
You may wish to talk with Prolinx Gateways. They make gateways for protocol conversion that also convert from ethernet to say serial, etc. This would be my first place to look. Hope you find a solution.
 
A

Alex Pavloff

ramana wrote:
> 1) I have to convert standard MODBUS TCP packets/requests to a
> proprietary protocol using a gateway sort of device having an IP
> address.
> The proprietary protocol devices are connected to this gateway with a
> serial line sub-network.
>
> Also the same gateway is required to convert the responses from the
> proprietary devices to MODBUS TCP.
>
> How shall i go about that?. Any ideas?.

You're going to need to write custom code. You don't need a full PC to do this, as there are many small microcontrollers with ethernet could handle this (look at Rabbit Semiconductor -- I've done a Modbus TCP/RTU slave with that easy). You could use a full PC if that what you've got, but this seems like a small job, and well, PCs are usually hard to attach to DIN rails.

> 2) What will be the value of UNIT IDENTIFIER if more than 1 MODBUS slave
> ( server) is directly connected to ethernet with a network interface.
>
> I understood from one of the documents that, it is 0xFF for
> all of them.
> Is it correct?.
No, its not 0xFF. It's usually 1. The unit identifier is fairly irrelevant with Modbus TCP unless you've got multiple logical devices on on IP address.

> 3) How to configure the proprietary protocol devices in MODBUS MASTER
> (client) so that it can send quieries to the respective devices.
That's your job to figure out how you're going to map Modbus to the proprietary protocol.

> 4) If 2 such gateways are there ( with one MODBUS TCP
> master) then - the value of UNIT IDENTIFIER shall be unique across
gateways or not.

Nah. If they've got different IP addresses, the Unit Identifier is irrelevant.

> ex: Can one MODBUS end unit on one gateway (assuming each proprietary
> device is treated as one MODBUS end unit) have UNIT IDENTIFIER=1 while
> another MODBUS end unit connected to another gateway has UNIT
> IDENTIFIER=1.
If they're plugged in via Modbus TCP, yes.

Alex Pavloff - [email protected] Eason Technology -- www.eason.com
 
D

Diego Urda Carrasco

Sorry for my poor english. Anyway:
Recently I have developped a communication gateway WIN32 application betwen a PLC Momentum (Modbus TCP/IP Prot) and a PLC Moeller wich communicates via serial port with a propietary protocol (SUCOMA32). This application´- Delphi language - makes bidirectional transfer betwen both PLC's. Works fine.
My idea: Pc is the server communications for both PLC's. At the start, the Server must know the ip address of PLC Momentum (Modbus TCP/IP slave). Then, server tries a winsock32 connection. If detects response from PLC Momentum, go to asyncronous winsock mode, else try again or exit, as user like. In the serial side, I use a SUCOMA32.DLL library with the functions under propietary protocol. If you no have any DLL or OCX for this, you must develop at least two functions to read and writte values, using the propietary protocol.
With 4 system timers, the application reads first the 4xxxxx registers from Modbus TCP/IP, then writtes other 4xxxxx regiister to Mobus TCP/IP, then reads via SERIAL and finally writtes via SERIAL and so on.
For transfer 4xxxxx registers values tu Modbus TCP/IP I send a array of values under Modbus TCP/IP protocol. The same to read. The input of values sended by the modbus TCP/IP slave, is in async mode, processed for the Windows Messages Processor, wich delivers a array of values according modbus TCP/IP protocol. Reading and witting to serial port is with anothers array in accordind SUCOMA32.DLL functions. A fine application must check modbus exception code sended by Modbus TCP/IP slave.
My application has Menus for work in test mode to check communications, prompting the transaction in a Memmo Field, and the register values in another memo field.
Best Regards, D. Urda
 
S

Swaroop - L&T Automation Systems Ce

Hi,

Ans to Q1: I feel you will have to develop the gateway around a uController with preferably with an inbuilt Ethernet & UART controller. Also if you have'nt visited already, visit www.modbus.org They have a document on Modbus-TCP implementation guide with all details

Ans to Q2: Unit Identifier will be used to address the proprietary protocol devices (I'm assuming that its a network on 485) since they all share the same IP from when viewed from the modbus clinet's point of view. As far as the Unit ID for the clinet itself, its 0 (only one device for one IP).

Ans to Q3: Example, the client is a HMI running on a PC, it will poll all the devices on the serial line by changing the Unit ID in the MBAP header. Also, a separate connection (socket pair) is established for with each device but on the common IP.

trust this is useful. Please do mail me for any details. (I'm working on a very similar project using Coldfire 5272 and uCLinux)
 
Top