Ethernet Units Operation Manual

141
Using Socket Services with CMND(490) Section 6-3
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: D30000 + (100 x unit number) +9 to +16. Refer to TCP Socket
Connection Status on page 75 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
response code (MRES). The second byte provides details and is called the
sub-response code (SRES).
Response Codes in the Results Storage Areas
The response code stored in the Results Storage Area is a 2-byte code that
indicates the processing results of the socket service requested by the com-
mand. This response code is stored in the Results Storage Area when pro-
cessing 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
before it can be used for socket services. Opening a TCP socket establishes a
connection.
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.
14 Results Storage Error
Flag
ON Unit Turns ON when there is an error in the Results Storage Area speci-
fied for the service request command to the Ethernet Unit. This flag
will turn ON at the same timing as turning OFF bits 0 to 3 (i.e., at
completion of processing).
OFF Turns OFF when the next request is received for processing.
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.)
Bit Flag Status Manipulated
by
Unit operation