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
Содержание CP1L-EL20DR-D
Страница 3: ...CP1L EL20D CP1L EM30D CP1L EM40D CP1L EL EM CPU Unit Operation Manual Produced July 2017...
Страница 4: ...iv...
Страница 10: ...x...
Страница 22: ...xxii...
Страница 34: ...xxxiv Software Licenses and Copyrights 7...
Страница 178: ...144 Connecting the CX Programmer Section 5 1 Click the Connect button to connect and then connection online is completed...
Страница 192: ...158 Trial Operation and Debugging Section 5 3...
Страница 250: ...216 Automatic Clock Adjustment and Specifying Servers by Host Name Section 6 7...
Страница 666: ...632 Trouble Shooting Section 11 7...
Страница 696: ...662 Standard Models Appendix A...
Страница 805: ...771 Connections to Serial Communications Option Boards Appendix F Connecting to Unit...
Страница 806: ...772 Connections to Serial Communications Option Boards Appendix F...
Страница 836: ...802 PLC Setup Appendix G...
Страница 838: ...804 TCP Status Transitions Appendix H...
Страница 840: ...806 Ethernet Network Parameters Appendix I...
Страница 842: ...808 Buffer Configuration CP1L EL EM Appendix J...
Страница 844: ...810 Ethernet Specifications Appendix K...
Страница 851: ...Index 817 work words 118 write protection 447...
Страница 852: ...818 Index...
Страница 854: ...820 Revision History...
Страница 855: ......