A Nano-10 operating as a Modbus/TCP client cannot maintain simultaneous connections to several servers because it has one client socket. Poll multiple servers by closing the current connection completely, reusing the socket for the next server, and coordinating every transition with STATUS(3).
Single-client-socket constraint
The Nano-10 must close its existing server connection before opening another. The socket can be reused immediately after the network stack finishes closing it, so sequential polling can operate with limited switching latency on a local-area network.
| Socket state | STATUS(3) |
Permitted action |
|---|---|---|
| Connection established | 1 |
Issue READMODBUS or WRITEMODBUS. |
| Closing or not connected | Do not assume completion until it becomes 0
|
Wait before connecting to the next server. |
Use STATUS(3) as the socket interlock
STATUS(3) becomes 1 after the connection has been made. Network traffic or latency can delay this transition. Do not send a Modbus read or write merely because the connection request has been issued; wait for the confirmed state.
Closing a socket also requires network-stack housekeeping. STATUS(3) returns to 0 only after the socket is fully closed. Starting the next connection earlier can leave the previous connection active and cause the new connection attempt to fail.
Implement the round-robin sequence
- Select the next Modbus/TCP server.
- Open the client connection to that server.
- Wait until
STATUS(3)equals1. - Issue the required
READMODBUSorWRITEMODBUScommand and receive its result. - Close the socket.
- Wait until
STATUS(3)equals0. - Advance to the next server and repeat.
Make both status transitions explicit states in the PLC sequence. A continuously advancing loop that does not wait for connection and closure completion can become stuck because it attempts to reuse a socket that is still active.
Evaluate the polling-cycle requirement
A reported round-robin test opened a connection, sent a command, received data, closed the connection, and moved to the next server within a fraction of a second. The report suggested that five network controllers could be cycled in less than 1 second, but the time was not measured. Treat that result as feasibility evidence, not a guaranteed Nano-10 timing specification.
For an application requiring one analog sample every second plus two noncritical digital modules, measure a complete production-like cycle. Include connection establishment, the Modbus transaction and response, socket closure, and any delay caused by network loading or individual server response time. Give the time-critical analog server scheduling priority if the full round-robin cycle approaches the required interval.
Verify the implementation
Log or observe each server selection, both STATUS(3) transitions, command completion, and total cycle time. Test with all intended servers connected and with representative network traffic. The sequence passes when every Modbus command starts only at status 1, every server change occurs only after status 0, no connection attempt stalls behind the preceding socket, and the measured analog update interval remains within the application requirement.
FAQ
Can a Nano-10 keep Modbus/TCP connections open to several servers?
No. It has one client socket, so it must close the current connection completely before connecting to another server.
Why does Nano-10 STATUS(3) not change immediately?
Connection establishment can be delayed by network traffic or latency, while closure requires network-stack housekeeping. Wait for STATUS(3)=1 before a Modbus command and STATUS(3)=0 before selecting the next server.
Can a Nano-10 poll five Modbus/TCP servers in under one second?
A reported test suggested that five controllers could be cycled in less than 1 second, but the interval was not measured. Verify the complete round-robin time with the actual servers, commands, and network load.