![]() ![]() There are even a number of Modbus libraries for Arduino boards, with this one being of the RTU variety. There are many Modbus libraries for all sorts of platforms and in many different languages, C, C++, Python, NodeJS, even PHP. The use of Modbus in the Arduino world to achieve the same, and hence a Modbus library for Arduino style boards. The Modbus protocol is now an open data protocol and has gained increasing attention and popularity in recent years, with many device manufactures now implementing some form of Modbus connectivity, usually RTU or TCP. The Modbus protocol was initially used in industrial automation, way back in the 1970's, which is what I do for many years now, and is used as a means to connect devices, whether that be PLCs or computers or remote I/O over a common and well defined and rugged data protocol. ![]() The modbus library have been written mainly to frequently read sensors on a modbus thus there are routines in the library which make it easy to poll sensors and get their current readings. You need to work out which end, slave or master will have priority of control of machine state, which has nothing to do with Modbus and which is Modbus slave or master. Then have some logic in the slave that reads the master command and act on that. Try to remember that the master is in control of everything, with the slaves only existing as mail boxes, the master is the postman.įor what you want to do, you need the master to read the slave data and then combine the machine state with the master command machine state and send that back to another address in the slave. So, only the master can send data from its address0 to the slave. You are describing that the slave reads data from the master, this can not happen, only the master can initiate any form of data transfer, not the slave. I have a unique slave (ID1), let call it "machine", reading address0 from master we can know if the machine is On or Off, sending a packet like: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |