![Omron CS1W-ETN01 Operation Manuals Download Page 133](http://html1.mh-extra.com/html/omron/cs1w-etn01/cs1w-etn01_operation-manuals_742528133.webp)
6-3
Section
Using Socket Services with CMND(490)
121
Bit
Unit operation
Manipulated
by
Status
Flag
15
Socket Open Flag
ON
Unit
Turns ON when open processing has been completed (i.e., when
a connection is made).
OFF
Turns OFF when close processing has been completed. (Will
remain OFF when open processing ends in an error.)
Note The TCP socket connection status is also provided as codes in the following
words of the words allocated to the Ethernet Unit in the CPU Bus Unit Area in the
DM Area: (100 x unit number) +9 to +16. Refer to TCP Socket Con-
nection Status on page 58 and to Appendix D TCP Status Transitions for details.
Response Codes in the Command Response
A response code is returned in the command response as a 2-byte code that
indicates the results of command execution. The response code is returned just
after the command code in the response. The first byte of the response code
provides the overall result of command execution and is called the main re-
sponse code (MRES). The second byte provides details and is called the sub-re-
sponse code (SRES).
Response Codes in the Results Storage Areas
The response code stored in the Results Storage Area is a 2-byte code that indi-
cates the processing results of the socket service requested by the command.
This response code is stored in the Results Storage Area when processing has
been completed.
Using Socket Service
Each Ethernet Unit has eight TCP sockets and eight UDP sockets. Open, close,
send, and receive processes are available for communications with sockets.
Open
Enables communications on a specified socket. A socket must be opened be-
fore it can be used for socket services. Opening a TCP socket establishes a con-
nection.
Close
Ends use of the socket. Breaks the connection for a TCP socket.
Send
Sends data from a specified open socket.
Receive
Specifies an open socket and receives data from that socket.
These processes are carried out by sending FINS commands to the Ethernet
Unit. The process from sending a request for processing to completion is shown
in the following illustrations.
1, 2, 3...
1. Execute a socket service request command (MRC: 27) for the Ethernet Unit
using CMND(490).
Socket service
Request
command
CPU
User program
Ethernet Unit
CMND
END