
Using Socket Services with CMND(490) | Section |
Program Flow
Check socket status.
Is Bit 15 (Open Flag) in the socket status word for the socket being used OFF?
(Checks to see if the socket is open before com- munications and close processing.)
Check the Port Enabled Flag.
Is the Port Enabled Flag in A502 for communica- tions port ON?
Start UDP Open
OFF?
NO
YES
ON?
NO
YES
Error Evaluation
The specified UDP socket is already open.
The specified port is running network communications.
Execute FINS command (via CMND(490)) for Ethernet Unit.
Use the CMND(490) to send the UDP OPEN RE-
QUEST command (2701) to the Ethernet Unit.
Check response. |
|
| 0000? |
|
| ||
|
|
| YES |
Is the response code = 0000 (normal) for the | |||
UDP OPEN REQUEST command? |
| ||
|
|
|
|
Check Opening Flag status. |
|
| ON/OFF |
|
| ||
|
|
|
|
NO
An error occurred. The Ethernet Unit did not receive the UDP OPEN REQUEST command.
(Socket status bit 00)
Wait until bit 00 in the socket status turns OFF (open complete).
Check results storage area response code.
Is response code = 0000?
0000?
NO
YES
UDP opened
An error occurred. The specified socket could not be opened.
6-8-3 Basic FINS Command Format
The basic format for FINS commands used for socket services is shown in the following diagram.
0 | 1 |
| 2 | 3 | 4 | 5 | 6 | 7 |
|
| 8 | 9 10 11 12 |
| Byte order from the | |||||
| |||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| beginning of the frame |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |||
Command |
|
|
|
|
| Results storage area |
| Parameters |
|
| |||||||||
|
|
|
|
|
|
|
| ||||||||||||
code |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
| Socket number |
|
|
|
|
|
|
|
|
|
|
| |||
|
|
| Socket option |
|
|
|
|
|
|
|
|
|
|
|
|
Command Code:
Specifies the process code requested from the socket.
Socket Option
For the TCP OPEN REQUEST (ACTIVE or PASSIVE) command, specifies whether or not the
Socket Number
Specifies the socket number for the process, between 1 and 8.
Results Storage Area
Specifies the area to store the results of the requested process.
Parameters
Specifies the parameters defined for the command code.
138