Modbus TCP / Modbus UDP
vacon • 73
Local contacts: https://www.danfoss.com/en/contact-us/contacts-list/
7
7.1
Modbus UDP vs TCP
In addition to TCP, the option boards also support UDP (from OPTE9 firmware version V006). It is
recommended that UDP is used when reading and writing rapidly and repetitively (cyclically) same
data as in case of process data. TCP must be used for single operations, like service data (e.g.
reading or writing parameter values).
The key difference between UDP and TCP is that when using TCP each and every Modbus frame
needs to be acknowledged by the receiver (see the figure below). This adds extra traffic to the
network and more load to the system (PLC and drives) because software needs to keep track of sent
frames to make sure that they have reached their destination.
Figure 34. Modbus TCP and UDP communication comparison
Another difference between TCP and UDP is that UDP is connectionless. TCP connections are
always opened with TCP SYN messages and closed with TCP FIN or TCP RST. With UDP, the first
packet is already a Modbus query. The option board treats IP address and port combination as a
connection. If port 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 is destination. 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 PLC does not receive response in time from drive in UDP connection, 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 35 ). If PLC sends new queries during this time,
some of those may not be sent to network (by TCP/IP stack) until previous sent package(s) has been
acknowledged. This can cause small packet storms when the connection is resumed between PLC
and drive (See Figure 36).
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 optea
Page 2: ......