proprietary ascii protocol embedded in modbus


Thread Starter

kris Duff


I'm working in a company that produce devices. Our devices communicate with a server using rs232 radios. The frame is 16 bytes wide and is ascii based.

One of our potential clients tells us that in their country they cannot use radio frequency and they asks us to integrate our system in their modbus-tcp environment.

I am seeking a solution that won't bring me in 6 month of development to change our firmware and software to support the new protocol. I was looking for a device that could embed our frame in an modbus-tcp frame. I know there is gateway (modbus-ascii -> modbus-tcp) but they won't convert to my proprietary format. I have found the device anybus communicator, seems great but will only works with a slave, not with a master.

Moreover, regarding the frame, from my reading of the protocol there is 2 type of rs232 frame. The ascii and the rtu. Do we have to implement both ?

Finally, if I have to implement the modbus-ascii protocol in my device, I don't understand how to manage the function with my application. I don't have coils, I only have few analog, almost everything is data on 10 or more bits)... (temperature, resistance, power, voltage...) and I don't want to access 1 item per query, ideally, it would be to embed my current frame in the data field of the modbus, but how to do that a compliant way ... I don't know yet...

I'm new with the modbus protocol and would appreciate to have information from you, experts !

Thank you a lot.
Hi has a Modbus ASCII to Modbus TCP/IP gateway that can act as a Master/Slave Client/Server, the unit will be able to map the registers according to what your devices demands.

Thank you for your reply.

The modbus RTU/ASCII is not implemented in my device. A simple gateway will not be sufficient for my needs.

Thank you for your time!


Lynn August Linse

Directyl to your questions:

1) Modbus/TCP is NOT Modbus/RTU in TCP. Much of the message is the same, but the Modbus/TCP has an extra 6 byte header and no CRC16.

2) You can put Modbus/RTU-in-TCP/IP, however only a small percentage of devices can work with that.

3) As for serial, you can do either RTU or ASCII or both. ASCII requires twice as many bytes and often is NOT supported. You would be better to first support Modbus/TCP as binary in TCP, then consider RTU and only if you have lots of spare time, add in Modbus/ASCII as last resort.

4) You may NOT embed ASCII strings as ASCII - Modbus/ASCII is a pure function of the RTU binary mapped as 2 bytes per RTU BYTE.

So this is ILLEGAL: ":010304STOPB3\r\n"

You can move strings as RTU data, so the 'S' in RTU data would map to the 2 bytes '53' in the ASCII message. So the above might be ":01030853544F504C\r\n" (I just made up the BCC values).

5) In the end you will need to map your data to normal Modbus 'holding registers' or no common Modbus master can use your data. In other words, making Modbus messages no Modbus master can understand won't satisfy your customer.

6) If you have a few odd functions which cannot be mapped, I have seen people use the Modbus 'read file' and 'write file' functions to move old legacy protocols intact. However, few off-the-shelf Modbus devices could parse such pure legacy ASCII, so it would only be of use within custom software.

You should use module with ethernet and serial port.

For example MMNET01. Modbus TCP/IP is easy protocol so you should spend no more than 2 weeks to make the bridge between your ascii protocol and Modbus TCP/IP.