[TriEmbed] ADC

John Vaughters jvaughters04 at yahoo.com
Tue Oct 27 16:22:16 CDT 2020


Just to be clear, MODBUS started as a serial protocol with error checking which is now called MODBUS RTU. MODBUS was later added to TCP in two methods. MODBUS over TCP which encapsulated the error checking and is really just a TCP wrapper. Then the supported MODUS TCP which strips the error check and let's TCP do that work and then has some headers that do not really do much. Many companies have utilized MODBUS UDP but it is not formally supported by MODICON. But it works great actually, however, it is not a standard and can vary in implementation. MODBUS over TCP or UDP is just a straight conversion of MODBUS RTU from serial encapsulated into TCP or UDP. But you need both sides to convert. Think Virtual Serial technologies. ser2net is a good utility for that, but I try to stay away from that too, even though it is fairly robust. Just too many extra steps and not needed unless it is needed and sometimes it is.

So basically the following is what you want to consider when thinking about MODBUS

MODBUS RTU - serial communications of any kind UART TTL,232,422,485 pretty much any serial scheme
MODBUS TCP - Network comms

I would agree that you can wrap the comms in just about any protocol. I just do not see much need in that. MODBUS fails as a rich messaging platform. I'm not sure why anyone would want to wrap it in MQTT unless it is just a conversion to a device that speaks MODBUS. I mean, I guess there are cases for anything. There is one more MODBUS supported that I never use called MODBUS ASCII. I have actually never seen it used in all my years dealing with equipment. So I have always disregarded it.

What the MODBUS utility mbusd does is convert MODBUS RTU to MODBUS TCP by stripping and packing the needed strings to make it match the TCP standards requirements. The other nice thing about mbusd, is it allows multiple devices to hit the single serial port via TCP. Of course with a polling load limited to the speed of the serial port. I run mine at 115200 BAUD and the wire length is usually only a few inches, so it responds pretty well even to multiple devices with occasional non-responses. I am not looking for super fast comms, so I have not idea how well it would work if you need that. I have seen but not played with some binary comm solutions designed for speed, but now I am getting off topic. 

MODBUS is super simple and matches up perfect for arduino or esp devices. 

Highly Recommended! 

It's my go to protocol simple and reliable.

John Vaughters



On Tuesday, October 27, 2020, 3:37:53 PM EDT, Scott Hall via TriEmbed <triembed at triembed.org> wrote: 






Modbus can be used over a TTL serial link -- as long as you take electrical characteristics into consideration.  In fact, modbus has been used in many connection types, even parallel buses and wireless links.  I've even seen modbus embedded in another protocol layer, such as Zigbee, MQTT or of course TCP.  A RS485 link requires a balancing circuit or transformers at either end and is really designed for long or multidevice signaling, and not needed for short wire or direct bus connections in close proximity.




- sgh











More information about the TriEmbed mailing list