15 Ethernet
15-50
CP2E CPU Unit Software User’s Manual(W614)
TCP Socket Close Request
Note These response codes will be returned only on large, multilevel networks.
For details, refer to SECTION 6 Socket Services in the Ethernet Units Construction of Applications
Operation Manual (Cat. No. W421).
The following programming example illustrates transferring 100 bytes of databetween an Ethernet Unit
and a host computer using TCP/IP communications.
z System Configuration
The programming example uses the following system configuration. For the TCP connection, the
Ethernet Unit uses a passive open and the host computer uses an active open.
z Data Flow
The data will flow between the CPU Unit, Ethernet Unit, and host computer as shown in the following
diagram.
Note Here, “execution bits” refer to W0.00 to W0.03, which are used in the ladder diagram to con-
trol execution of communications.
Responsecode Meaning
0000 Normal end
0302 CPU Unit error; cannot execute.
2210 The specified socket is not been connected.
2607 Specified Socket Service Parameter Area is already being used foranother socket.
15-5-7 Socket/TCP Programming Example
TCP/IP Communications Programming Example
Host computer
Ethernet Unit
IP address: 192.168.250.5
Port number: 4096
IP address: 192.168.250.1
Port number: 4096
PLC
Host computer
Line
(Ethernet)
Ethernet
Unit
CPU Unit
Request Switches and ex-
ecution bits turned ON
(see note).
Sent to line.
Processing in
host computer
Execution bits turned OFF