7.2
Communication Using UDP
UDP (User Datagram Protocol) is a simple protocol that does not perform data sequencing and retransmission.
To perform socket communication using UDP, confirm the following in advance.
• IP address and port number of the target device
• IP address and port number of the CPU module
(1) Program example
This section provides a program example for communication using UDP.
(a) Parameter setting
The following parameters are set for the sample program.
Project window
*1
The
• For "Ethernet Conf.", drag and drop "UDP Connection Module" from "Module List" to the left side on the
window. Set the port numbers and IP address as mentioned below.
PLC
Sensor/Device
[Parameter]
[PLC Parameter]
/
button
button can be used with the QnUDVCPU.
Item
4096 (Setting range: 1 to 4999, 5010 to 65534)
Do not specify 5000 to 5009 because these ports are used by the system.
Port No.
(
IP Address
192.168.3.40 (Setting range: 0.0.0.1 to 223.255.255.254/255.255.255.255)
Port No.
4096 (Setting range: 1 to 65534/65535)
CHAPTER 7 SOCKET COMMUNICATION FUNCTION
[Built-in Ethernet Port Setting]
*1
Setting
Page 200, Appendix 2)
7
97