Reputation: 77
I'm a bit new to Modbus communications and I've started reading about the "Free Modbus" library. Now, I understood how to use it to implement the slave side of the Modbus communications, but I just can't seem to find how to use the library on the master's side. For example, what function show I call on the master's side to read discrete input number 3 of slave 19 (for instance)?
Thank you in advance for the help.
By the way, I'm writing in C and am programming for a MSP430 microcontroller.
Upvotes: 2
Views: 1260
Reputation: 8860
It's not stated directly on the website, but FreeMODBUS library supports only slave side. For example in the init function ( modbus.html#ga0">http://www.freemodbus.org/api/group_modbus.html#ga0 ) one of the parameters is "ucSlaveAddress" - address of your (slave) device.
The guy that created FreeMODBUS now works on commercial libs, and there's is a library for master mode - http://www.embedded-solutions.at/index.php/en/products/modbus-master
Upvotes: 5