
Using Socket Services by Manipulating Dedicated Control Bits | Section |
m = D30000 + (100 x unit number)
CPU Bus Unit Area in the DM Area
15 | 0 | ||
m+18 |
|
| |
| Socket Service Parameter Area 1 | ||
m+28 |
|
| |
Socket Service Parameter Area 2 | |||
| |||
|
|
|
m+88
Socket Service Parameter Area 8
Parameters
Socket option UDP/TCP socket No.
Local UDP/TCP port No.
Remote IP address
Remote UDP/TCP port No.
Number of bytes to send/receive
Send/Receive data address
Time out time
Response code
2.Turn ON the Socket Service Request Switches in the CPU Bus Unit Area in the CIO Area.
CPU Bus Unit Area in the CIO Area
Socket Service | Socket Service | Close Request |
|
Request Switches 2 | Request Switches 1 | UDP Open Request Switch | |
|
| Switch |
|
|
| Receive Request Switch | TCP Passive Open Request Switch |
Socket Service | Socket Service | Send Request Switch | TCP Active Open Request Switch |
Request Switches 8 | Request Switches 7 |
|
3.When a send or receive request is made, the data will be automatically sent or received according to the send/receive data address in the Socket Service Parameter Area. When processing has been completed, a re- sponse code will be automatically stored in the Socket Service Parame- ters.
Number of bytes to send/receive
Send/receive data address
I/O memory
Response code
Send
or
Receive
Stored
Precautions
A Socket Service Parameter Area cannot be used for other sockets once open processing has been successfully completed for it. Check the socket status before attempting to open a socket. TCP socket status is provided in words m+9 to m+16 in the DM Area for sockets 1 to 8.
6-7-2 Socket Services and Socket Status
When using socket services, it is important to consider the timing of the status changes in the Socket Status Area. The diagram below shows a flowchart for opening UDP.The flow is similar for other socket services. Replace the names of the appropriate flags in the flowchart to adapt it to other socket services.
113