Does anyone know of a good (preferably open source) library for dealing with the Modbus protocol? I have seen a few libraries, but I am looking for some people's personal experiences, not just the top ten Google hits. I figure there has to be at least one other person who deals with PLCs and automation hardware like I do out there.
Open to any other materials that might have been a help to you as well...
A Modbus library for Linux, Mac OS X, FreeBSD, QNX and Win32 A free software library to send/receive data according to the Modbus protocol. This library is written in C and supports RTU (serial) and TCP (Ethernet) communications.
Modbus communication protocol was developed in 1979, and almost 40 years later, it is still used on many industrial sites. It is pretty cool that this openly published, free, simple protocol has been adopted by so many manufacturers to exchange information.
Don't use Modbus if you have a lot of data to transfer. The packets are limited to around 120 bytes maximum. Transferring 1K requires almost ten messages. It's just not efficient for any kind of large data transfer.
The biggest drawbacks of modbus tcp / ip network is that modbus has no form of object but only space reserved for addresses. It uses only two types of data (boolean and 16bit unsigned integer). It is limited to EtherNet / IP, ProfiNet IO, OPC UA .. etc. It has a relatively low data rate (Kbit / s).
I have done a lot of communication with devices for the past few years, since I work for a home automation company, but we don't use Modbus. We do communication in a standard and open way using Web Services for Devices(WSD) which is also know as Devices Profile for Web Services(DPWS).
During this time at one point, I did hear of a project called NModbus. It is an open source library for working with modbus. I have not used it, but looking at the site and the changesets on Google Code, it looks pretty active. You may want to give it a look and even get involved in. This is the only library that I have heard of that targets .Net.
Modbus is a very simple protocol to implement. All information you need can easily be found for free on the Internet.
If you choose to implement it yourself, I will be happy to answer any questions you have along the way.
If you choose to go for a modbus master library I would look for:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With