209
Socket Services
Section 6-6
Programming Example
TCP Close
TCP Passive Open
MOV(021)
#1
D32408
W0.00
W0.00
@RSET
W1.00
@SET
W2.00
MOV(021)
#1000
D32409
W2.00
W0.01
SET
A571.05
RSET
W2.01
W2.01
W0.01
SET
W1.01
W2.01 A571.05
<>(305)
D32417
#0
W0.00
RSET
W0.00
W2.00 A571.01
W0.01
@RSET
W1.01
@SET
W2.01
MOV(021)
#1
D32408
W0.01
W2.01
W0.00
SET
W1.00
W2.00 A571.01
<>(305)
D32417
#0
W0.00
SET
A571.01
RSET
W2.00
W2.00
W0.01
RSET
W0.01
W2.01 A571.05
MOV(021)
#C0A8
D32410
MOV(021)
#FA05
D32411
MOV(021)
#0
D32412
MOV(021)
#0
D32416
When the TCP Open Bit (W0.00) turns ON, the TCP
Open Error Flag (W1.00) is turned OFF and the TCP
Opening Flag (W2.00) is turned ON to initialize
processing.
After the execution results have been checked, the
TCP Close Bit (W0.01) is turned OFF.
If the Close Request Switch (A571.05) turns OFF
while the TCP Opening Flag (W2.01) is OFF, the
contents of the response code (D32417) in the
Socket Service Parameter Area is checked, and if it
is not 0000 Hex (normal end), the TCP Close Error
Flag (W1.01) is turned ON.
After the parameter has been set, the Close Request
Switch (A571.05) is turned ON and the TCP Closing
Flag (W2.01) is turned OFF.
When the TCP Closing Flag (W2.01) turns ON, the
following parameter is written to the parameter area for
socket number 1.
D32408: 0001 Hex = UDP/TCP socket No. 1
When the TCP Close Bit (W0.01) turns ON, the TCP
Close Error Flag (W1.01) is turned OFF and the TCP
Closing Flag (W2.01) is turned ON to initialize
processing.
After the parameters have been set, the TCP Passive
Open Request Switch (A571.01) is turned ON and the
TCP Opening Flag (W2.00) is turned OFF.
If the TCP Passive Open Request Switch (A571.01)
turns OFF while the TCP Opening Flag (W2.00) is OFF,
the contents of the response code (D32417) in the
Socket Service Parameter Area is checked, and if it is
not 0000 Hex (normal end), the TCP Open Error Flag
(W1.00) is turned ON.
After the execution results have been checked, the
TCP Open Bit (W0.00) is turned OFF.
When the TCP Opening Flag (W2.00) turns ON, the
following parameters are written to the parameter
area for socket number 1.
D32408: 0001 Hex = UDP/TCP socket No. 1
D32409: 1000 Hex = Local UDP/TCP port No. 4096
D32410 and D32411:
C0A8 FA05 Hex =
Remote IP address 192.168.250.5
D32412: 0000 Hex = Any remote UDP/TCP port No.
D32416: 0000 Hex = No timeout time
Continued on next page.
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: ......