6F8C0904 103
6.4 Using the EN311 Socket Interface
6
6.4.1 UDP open request (using the USEND_T instruction)
(1) Function
This request opens any of the eight sockets.
Transmission protocol:UDP/IP
(2) Request command structure and error status
<Request command>
<Error status>
Error status examples
(3) Considerations
• After this request completes normally, UDP send, receive or close requests can be
sent to the socket.
• An error is returned if an open request is issued for an already open socket.
Error status: Already opened ••• 2944(16#B80)
• An error is returned if a socket identifier other than 1 to 8 is specified.
Error status: Invalid socket identifier ••• 5004(16#EC74)
• An error is returned if a value other than a local node specified socket UDP port
number is specified.
Error status: Port number error ••• 2929(16#B71)
• Not only must the specified socket UDP port number on the local station not overlap
with UDP port numbers used for message transmission and previously used UDP port
numbers, but it also must not overlap with any TCP port number. An error will occur if
the port number overlaps.
Error status: Already open ••• 2944(16#B80)
• If the S controller internal completion wait time limit (2 seconds) is exceeded for this
request, the error listed below is returned.
Error status: Send completion timeout ••• 5002(16#EC76)
In this case, first verify that the module is not in the down state by checking the station
status, and then verify the open/closed state of the socket in the socket status.
F0
CMD Destination EN311 module slot number
CMD+1 Command (16#0331)
CMD+2 Socket identifier Value:1-8
CMD+3 Specified socket UDP port number of the local node Value:1024-65535
F0
STATUS Socket identifier (1-8) or Error status
Error status number Description
-5004(16#EC74) Destination EN311 module slot number is missing or socket identifier
is out of range
2912(16#B60) Transmission disabled
2944(16#B80) Already open