Modbus technical data
vacon • 9
Local contacts: http://drives.danfoss.com/danfoss-drives/local-contacts/
3
Figure 3. Modbus TCP and UDP communication comparison
Another difference between TCP and UDP is that UDP is connectionless. TCP connections are al-
ways opened with TCP SYN messages and closed with TCP FIN or TCP RST. With UDP, the first
packet is already a Modbus query. IP address and port combination is treated as a connection. If
port number changes, it is considered as a new connection or as a second connection if both stay
active.
When using UDP, it is not guaranteed that the sent frame reaches its destination. The PLC must
keep track of the Modbus requests by using the Modbus transaction id-field. It actually must do this
also when using TCP. If the PLC does not receive response in time from the AC drive in UDP con-
nection, it needs to send the query again. When using TCP, the TCP/IP stack will keep resending the
request until it has been acknowledged by the receiver (see Figure 4). If the PLC sends new queries
during this time, some of those may not be sent to the network (by TCP/IP stack) until previous sent
package(s) has been acknowledged. This can cause small packet storms when the connection is re-
sumed between the PLC and the AC drive (See Figure 5).
11716_uk
Modbus TCP Communication
PLC
Open
Connection
Communicate
Communicate
Close
Connection
Drive
TCP, SYN
TCP, SYN, ACK
TCP, ACK
Modbus Query
Modbus Query
Modbus Response, TCP, ACK
TCP, ACK
TCP, ACK
TCP, ACK
TCP, ACK
TCP, FIN, ACK
Modbus UDP Communication
PLC
Drive
Modbus Query
Modbus Response
Modbus Query
Summary of Contents for 100 INDUSTRIAL
Page 2: ......