CMB27 / ModbusRTUSlave

This is an Arduino library that implements the slave/server logic of the Modbus RTU protocol.
MIT License
72 stars 21 forks source link

Slave or master? #47

Open Fluxanode opened 2 days ago

Fluxanode commented 2 days ago

I think this is a master lib? Is this the querying device or data serving device? I've been working with modbus for a while, and believe the device that queries the network of sensors is the master or client and the data device being asked for data is the slave or host or server.

Definition:

In Modbus communication, the terms "master" and "slave" refer to the roles devices play in the network:

Modbus Master: The master is the central controller in a Modbus network. It initiates communication by sending requests to one or more slaves. The master decides when and how the data is exchanged, controlling the timing of communication. There is typically only one master in a Modbus network.

Modbus Slave: A slave device responds to the requests from the master. It waits for queries from the master and cannot initiate communication on its own. Multiple slave devices can be connected to the network, each with a unique address. Examples of slave devices include sensors, actuators, and controllers that provide data or accept commands. In summary, the Modbus master controls the communication and requests data or actions, while the Modbus slave provides data or performs actions when requested.

So is the a lib for a master or slave as defined above?

Another question, will this work with a teensy 4.1?

CMB27 commented 1 day ago

This library implements logic to respond to requests sent from Modbus RTU master/client devices. So, no, this is not a Modbus master/client library.

If you need a Modbus RTU master library, may I suggest ModbusRTUMaster.

I have not tested this library with any Teensy, nor have I heard of anyone else who has, so I really don't know if it will work or not.