Can you have multiple Modbus masters for one slave?
The current Modbus spec does not support a situation where you have to connect two clients to the same slave. There are two main reasons for this:
- If you are using RS232 then there can only be two devices on the cable segment.
- If you are using RS485 then the 2nd client will not know to process the poll from the 1st client. It will cause errors.
The solution would be to use one our multi-port FieldServers with an appropriate configuration. This would solve the problem whether you are using RS232 or RS485. It would allow you to connect each client to its own port and the slave(s) to their own ports. Each client will see a single virtual slave on its network. This not only solves the problem but is extremely efficient. In a situation like this, we exploit the FieldServer technology known as PEX (or ‘Port Expander Mode’).
How does it work?
Part 1: Each client is on its own port. Thus, each client does not see poll messages from the other client. In the example below, Client #1 sends a poll to the FieldServer directed to a specific slave address. When the poll arrives at the FieldServer, the FieldServer checks the address against its configuration. If there is no matching address then an exception response is sent. However, if there is a match, the FieldServer determines the port that the matching slave is configured on. The poll message is then relayed to the slave port.
Part 2: The slave responds to the poll message and sends it to the FieldServer. Then, the FieldServer relays the response back to Client #1. The FieldServer also extracts the data from the response and temporarily stores it in what's called a "cache block". The duration of how long this data is held is configurable.
Part 3: If either Client #1 or #2 requests the same data and the data hasn't expired, then the FieldServer will respond with data from its temporary storage.
Part 4: If either client requests different data, or if the temporary data has expired, then the match and relay process is repeated requesting the new data.
Part 5: The slave responds. The response is relayed to the client doing the polling (in this case, Client #2) and the data is also stored temporarily so that it is available to the other client.
If you would like us to configure a PEX solution for your Multiple Modbus Master problem, please CONTACT US