20
CHAPTER 7: PROGRAMMING USING SOCKETS
7.1
Socket Description
MODBUS TCP offers socket connections. Socket is a low-level protocol that is universally
available in all operating systems and programming environments.
7.2
Communicating Using Sockets
Communicating through sockets involves opening a socket connection, sending commands (MODBUS TCP
register address, and parameter) and reading the responses. The function by which a programming language
manages the socket is the TCP stack.
There is a single socket, TCP protocol, which may be used at port 502.
7.3
Controller Access
Up to 4 TCP socket connections can be opened at the same time.
NOTES
1. The performance of the
MODBUS TCP interface is impacted as more web pages and
sockets are open at the same time.
2. Multi-User control is not allowed in Multi-Drop configuration (power supplies are connected by Daisy-
Chain RS485 connection).
7.4
Input Buffer Requirements
With a controller using TCP sockets, the power supply can receive commands much faster than it can
process. To make sure the MODBUS TCP interface is not overloaded, it is required that the
controller sometimes sends a query and then waits for the response. The response is the acknowledgement
from the power supply that it has finished processing all commands.
It is recommended that your controller routinely sends “SYST:ERR?” query (Register 935). This query takes
about 60 to 80
mSec, and verifies that all commands have been accepted correctly.
NOTE
Timeout - If there is no active communication within one minute period, TCP connection is automatically
closed. A new socket connection should be establish to communicate with the power supply.