15-51
15 Ethernet
CP2E CPU Unit Software User’s Manual(W614)
15-5 Socket Services
15
15-5-7 Socket/TCP Programming Example
z 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 15-7-5 Socket
Service Request Switches for information on errors.
z Program Memory Map
The send and receive data and bits (flags) used by the program are shown in the following diagram.
DM Area
Send data, 100 bytes (100 = 0064 Hex)
Receive data, 100 bytes (100 = 0064 Hex)
D00000
D00049
D01000
D01049
15
00
15
00
WR Area
W0
W1
W2
15 03 02 01 00
TCP
Open Bit
TCP
Close Bit
TCP
Send Bit
TCP
Receive
Bit
TCP
Receive
Error Flag
TCP Send
Error Flag
TCP
Close
Error Flag
TCP
Open
Error Flag
TCP
Receiving
Flag
TCP
Sending
Flag
TCP
Closing
Flag
TCP
Opening
Flag