Programming Example - Omron CP1L-EL20DR-D Operation Manual

Sysmac cp series cp1l-el/em cpu unit
Table of Contents

Advertisement

Socket Services

Programming Example

W0.00
W0.00
W2.00
W2.00
W0.00
W2.00 A571.01
W0.00
W0.00
W2.00 A571.01
W0.01
W0.01
W2.01
W2.01
W0.01
W2.01 A571.05
W0.01
W2.01 A571.05
W0.01
Continued on next page.
@RSET
W1.00
@SET
W2.00
MOV(021)
D32408
MOV(021)
#1000
D32409
MOV(021)
#C0A8
D32410
MOV(021)
#FA05
D32411
MOV(021)
#0
D32412
MOV(021)
#0
D32416
SET
A571.01
RSET
W2.00
SET
<>(305)
D32417
W1.00
#0
RSET
W0.00
@RSET
W1.01
@SET
W2.01
MOV(021)
D32408
SET
A571.05
RSET
W2.01
<>(305)
SET
D32417
W1.01
#0
RSET
W0.01
TCP Passive Open
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.
#1
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
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.
TCP Close
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.
#1
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
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.
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 execution results have been checked, the
TCP Close Bit (W0.01) is turned OFF.
Section 6-6
209

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents