207
Socket Services
Section 6-6
TCP Socket Close Request
Note
These response codes will be returned only on large, multilevel networks.
Note
For details, refer to SECTION 6 Socket Services in the Ethernet Units Con-
struction of Applications Operation Manual (Cat. No. W421-E1).
6-6-7
Socket Application Example
TCP/IP Communications Programming Example
The following programming example illustrates transferring 100 bytes of
databetween an Ethernet Unit and a host computer using TCP/IP commu-
nica-tions.
System Configuration
The programming example uses the following system configuration. For the
TCP connection, the Ethernet Unit uses a passive open and the host com-
puter uses an active open.
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 control execution of communications.
Basic Operations
• W0.00 is turned ON to request opening a TCP socket from the Ethernet Unit.
• W0.01 is turned ON to request closing the TCP socket from the Ethernet Unit.
• W0.02 is turned ON to request sending data from the Ethernet Unit. Data
(100 bytes) is sent beginning at D00000.
• W0.03 is turned ON to request receiving data from the Ethernet Unit. The
data that is received (100 bytes) is stored beginning at D01000.
• One of the bits between W1.00 and W1.03 will turn ON if an error occurs.
Refer to 6-7-5 Socket Service Request Switches for information on errors.
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.
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
Summary of Contents for CP1L-EL20DR-D
Page 3: ...CP1L EL20D CP1L EM30D CP1L EM40D CP1L EL EM CPU Unit Operation Manual Produced July 2017...
Page 4: ...iv...
Page 10: ...x...
Page 22: ...xxii...
Page 34: ...xxxiv Software Licenses and Copyrights 7...
Page 192: ...158 Trial Operation and Debugging Section 5 3...
Page 250: ...216 Automatic Clock Adjustment and Specifying Servers by Host Name Section 6 7...
Page 666: ...632 Trouble Shooting Section 11 7...
Page 696: ...662 Standard Models Appendix A...
Page 805: ...771 Connections to Serial Communications Option Boards Appendix F Connecting to Unit...
Page 806: ...772 Connections to Serial Communications Option Boards Appendix F...
Page 836: ...802 PLC Setup Appendix G...
Page 838: ...804 TCP Status Transitions Appendix H...
Page 840: ...806 Ethernet Network Parameters Appendix I...
Page 842: ...808 Buffer Configuration CP1L EL EM Appendix J...
Page 844: ...810 Ethernet Specifications Appendix K...
Page 851: ...Index 817 work words 118 write protection 447...
Page 852: ...818 Index...
Page 854: ...820 Revision History...
Page 855: ......