(1) Port numbers
In socket communication, port numbers are used to identify respective communications and thereby multiple
communications are available both on TCP and UDP.
• For sending
Specify the port number of the CPU module from which data are sent, and the port number of the destination
device.
• For receiving
Specify the port number of the CPU module, and read out the data sent to the port.
CPU module
(IP address: xx.xx.xx.xx)
Port No.A
Port No.B
Port No.C
Ethernet
Sending UDP data from port No.A of the CPU
module to port No.L of external device 1
Sending UDP data from port No.L of
Port No.L
external device 1 to port No.A of the CPU
module
Sending data via TCP connection
Sending data via TCP connection
Port No.M
Sending UDP data from port No.C of the CPU
module to port No.N of external device 3
Sending UDP data from port No.N of
Port No.N
external device 3 to port No.C of the CPU
module
CHAPTER 7 SOCKET COMMUNICATION FUNCTION
External device 1
(IP address: yy.yy.yy.yy)
External device 2
(IP address: zz.zz.zz.zz)
External device 3
(IP address: ww.ww.ww.ww)
7
87