EasyManuals Logo

Omron SYSMAC CP2E-E D Series User Manual

Omron SYSMAC CP2E-E D Series
578 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #383 background imageLoading...
Page #383 background image
15-53
15 Ethernet
CP2E CPU Unit Software User’s Manual(W614)
15-5 Socket Services
15
15-5-7 Socket/TCP Programming Example
Note When using the above programming example, change the bit and word addresses as necessary to avoid
using the same areas used by other parts of the user program or the CPU Bus Unit.
TCP Receive
TCP Send
MOV(021)
#1
D16008
W0.02
MOV(021)
#64
D16013
W2.02
W0.03
SET
A571.04
RSET
W2.03
W2.03
W0.03
SET
W1.03
W2.03
A571.04
<>(305)
D16017
#0
W0.02
RSET
W0.02
W2.02
A571.03
W0.03
@RSET
W1.03
@SET
W2.03
W0.02
@SET
W1.02
W2.02
A571.03
<>(305)
D16017
#0
W0.02
SET
A571.03
RSET
W2.02
W2.02
W0.03
RSET
W0.03
W2.03
A571.04
MOV(021)
#8200
D16014
MOV(021)
#0
D16015
MOV(021)
#1
D16008
W0.03
MOV(021)
#64
D16013
W2.03
MOV(021)
#8200
D16014
MOV(021)
#0
D16015
MOV(021)
#0
D16016
W0.02
@RSET
W1.02
@SET
W2.02
A567.13
=(300)
D16000
&100
When the TCP Send Bit (W0.02) turns ON, the TCP Send Error
Flag (W1.02) is turned OFF and the TCP Sending Flag (W2.02) is
turned ON to initialize processing.
When the TCP Sending Flag (W2.02) turns ON, the following
parameters are written to the parameter area for socket number 1
D16008: 0001 Hex = UDP/TCP socket No. 1
D16013: 0064 Hex = No. of send/receive bytes is 100
D16014 and D16015:
8200 0000 Hex =
Send/receive data address D00000
After the parameters have been set, the Send Request Switch
(A571.03) is turned ON and the TCP Sending Flag (W2.02) is
turned OFF.
If the Send Request Switch (A571.03) turns OFF while the TCP
Sending Flag (W2.02) is OFF, the contents of the response code
(D16017) in the Socket Service Pa-rameter Area is checked, and
if it is not 0000 Hex (normal end), the TCP Send Error Flag
(W1.02) is turned ON.
After the execution results have been checked, the TCP
Send Bit (W0.02) is turned OFF.
When the TCP Receive Bit (W0.03) turns ON, the TCP Receive
Error Flag (W1.03) is turned OFF and the
TCP Data
Received/Requested Flag (
A567.13), and the Number of Bytes
Received at TCP Socket (D16000) are checked. If the data is stored
in the buffer, the TCP Receiving Flag (W2.03) turns ON.
When the
TCP Receiving Flag (W2.03) turns ON, the following parameters
are written to the parameter area for socket number 1.
D16008: 0001 Hex = UDP/TCP socket No. 1
D16013: 0064 Hex = No. of send/receive bytes is 100
D16014 and D16015:
8203 E800 Hex =
Send/receive data address D01000
D16016: 0000 Hex = No timeout time.
After the parameter has been set, the Receive Request Switch
(A571.04) is turned ON and the TCP Receiving Flag (W2.03) is
turned OFF.
If the Receive Request Switch (A571.04) turns OFF while the TCP
Receiving Flag (W2.03) is OFF, the contents of the response code
(D16017) in the Socket Service Parameter Area is checked, and if it
is not 0000 Hex (normal end), the TCP Receive Error Flag (W1.03)
is turned ON.
After the execution results have been checked, the TCP Receive Bit
(W0.03) is turned OFF.
Continued from previous page.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron SYSMAC CP2E-E D Series and is the answer not in the manual?

Omron SYSMAC CP2E-E D Series Specifications

General IconGeneral
BrandOmron
ModelSYSMAC CP2E-E D Series
CategoryComputer Hardware
LanguageEnglish

Related product manuals