<p>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.</p>

<p>Open to any other materials that might have been a help to you as well...</p>

[{'answer_id': 54900, 'author': 'Dale Ragan', 'author_id': 1117, 'author_profile': 'https://Stackoverflow.com/users/1117', 'pm_score': 5, 'selected': True, 'text': '<p>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 <a href="http://en.wikipedia.org/wiki/Devices_Profile_for_Web_Services" rel="noreferrer">Devices Profile for Web Services(DPWS)</a>.</p>\n\n<p>During this time at one point, I did hear of a project called <a href="http://code.google.com/p/nmodbus/" rel="noreferrer">NModbus</a>.  It is an open source library for working with modbus.  I have not used it, but looking at the site and the <a href="http://code.google.com/p/nmodbus/source/list" rel="noreferrer">changesets</a> 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.</p>\n'}, {'answer_id': 124226, 'author': 'Martin Liesén', 'author_id': 20715, 'author_profile': 'https://Stackoverflow.com/users/20715', 'pm_score': 3, 'selected': False, 'text': '<p>Modbus is a very simple protocol to implement. All information you need can easily be found for free on the Internet.</p>\n<p>If you choose to implement it yourself, I will be happy to answer any questions you have along the way.</p>\n<p>If you choose to go for a modbus master library I would look for:</p>\n<ul>\n<li>Modbus TCP support.</li>\n<li>Modbus RTU over TCP/UDP and COM-port.</li>\n<li>Configurable byte swapping, word swapping</li>\n<li>Configurable &quot;base&quot; address so you can choose address 1 to actually be address 0 (sounds stupid, but I prefer to always specify addresses the same way they are documented)</li>\n<li>it must support reading several addresses as a block, but it need to be flexible, some modbus slaves will return error if any address in the block is unused/reserved).</li>\n</ul>\n'}, {'answer_id': 5382998, 'author': 'Ganesh', 'author_id': 670100, 'author_profile': 'https://Stackoverflow.com/users/670100', 'pm_score': 0, 'selected': False, 'text': '<p>Have a look at the offering from Colway Solutions <a href="http://www.colwaysolutions.com" rel="nofollow">http://www.colwaysolutions.com</a>. They have a unique licensing scheme where you pay for each Modbus function code that you desire to use. Its not free but the pricing seems to be low. I also saw a few ports of the library to some popular microcontrollers and RTOS.</p>\n'}, {'answer_id': 9925235, 'author': 'CSharpDev', 'author_id': 1299154, 'author_profile': 'https://Stackoverflow.com/users/1299154', 'pm_score': 1, 'selected': False, 'text': '<p>FieldTalk Modbus Library - handles all Modbus functions</p>\n'}, {'answer_id': 18640285, 'author': 'VoteCoffee', 'author_id': 848419, 'author_profile': 'https://Stackoverflow.com/users/848419', 'pm_score': 3, 'selected': False, 'text': '<p>AdvancedHMI has a drivers package included that\'s just great for almost anything comms, though it may be a bit heavy if all you want is Modbus.  AdvancedHMI is also under active development and has a strong user base.\n<a href="http://sourceforge.net/projects/advancedhmi/" rel="nofollow">http://sourceforge.net/projects/advancedhmi/</a></p>\n\n<p>NModbus seems to be the most likely to have continued development and there are lots of example projects scattered over the internet.\n<a href="https://code.google.com/p/nmodbus/" rel="nofollow">https://code.google.com/p/nmodbus/</a></p>\n\n<p>I have liked using this one in the past (Modbus via TCP):\n<a href="http://www.codeproject.com/Tips/16260/Modbus-TCP-class" rel="nofollow">http://www.codeproject.com/Tips/16260/Modbus-TCP-class</a></p>\n\n<p>Modbus to a Siemens Logo PLC is a little different.  I have an example project I could send upon request.</p>\n'}]
['https://Stackoverflow.com/questions/54837', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5640/']