Arduino IDE and Modbus info;
It may 'appear' as though all of the Arduino boards will run the same code, but that is largely due to a trick used by the Arduino IDE. It is a good trick and serves a good purpose for the intended audience, but it causes a lot of confusion when using third party libraries (like Modbus).
The IDE contains a file which has the required parameters for each Arduino board. You tell the IDE which board you are using. The IDE looks up the parameters for your board for use in compiling your 'sketches' [Arduino speak for 'programs').
This process is transparent to the user, so there is a common misconception that all Arduinos can run the same code, but that is far from correct. Code that compiles for earlier boards will not necessarily compile for the newer boards if Arduino has not yet updated the libraries or provided new ones. When you download and install the latest IDE, you also get the updated libraries, but there is a catch . . . . only the Arduino supplied libraries are updated.
This may have changed, but last I knew, there is no Arduino supplied Modbus library. There are quite a few public (licensed, but free) libraries floating around, but most are quite old and will not work with the newer board. Some have been updated here and there and I *think* there may be bone that has been updated as far as the Arduino MEGA. I started with these little development boards right before the latest MEGA came out and when it hit the shelves, there were NO Modbus libraries that worked with it . . and I did a LOT of searching.
Ultimately, I took one of the libraries that 'sort of ' worked and re-wrote the parts that needed to be changed for the MEGA's processor and to include and call the MEGA's libraries.
Next up came the DUE board which is a massive improvement over the MEGA, however, extensive searching did not turn up a working Modbus SLAVE for the DUE.
It was Modbus purgatory all over again, this time requiring a much more extensive rewrite of the code I was using on the MEGA.
Another unexpected challenge is that the DUE has no EEPROM . . . as in NONE, and the new board was 3.3v only. Fortunately, the Arduino Ethernet 'shield' (Arduino speak for 'daughter card') not only was compatible with the 3.3v DUE, but had an SD card reader to store stuff . . . except that the SD library did not work on the DUE . . catch 22. Eventually, that got worked out and the new DUE is buzzing along nicely.
The bottom line is that if you have to use a non-Arduino library, do not expect it to work transparently on any Arduino board. 'Private' libraries are likely to be board specific and even support library specific. The better news is that sometimes all you need to do is change the names of the include files to match the ones for your board.
Users will need to research the particular board they plan to use. That's why I stated in a previous post the choice of board, if you are not able to re-program or create your own libraries, should be determined, in large part, but whether a working library is available for it that you will need for your application.
Keep all of this in mind before rushing out to get the latest and greatest ne board. I believe the newest board is based on the DUE. Similar to the relationship between the Leanardo and Yun