FCT_SOCKET: Creation of a New Socket
(Original Document)
Function Description
The FCT_SOCKET function creates a new socket and returns its socket number. The socket is a TCP/IP communication entity.
It is created as a STREAM TCP socket with the following options:
The additional parameters EN and ENO may be configured.
Representation in FBD
Representation in LD
Representation in IL
LD Module_Number
FCT_SOCKET Gest_Index,Management_Param, Socket_Number
Representation in ST
FCT_SOCKET(Module_Number, Gest_Index, Management_Param, Socket_Number);
Description of Parameters
The following table describes the input parameters:
Parameter
Type
Comment
Module_Number
Slot number of network module in rack 0.
  • Low byte is the slot number of network module in rack 0.
  • High byte can be used to extend the number of sockets.
    • 00: Provided for full backward compatibility with applications created on firmware version 3.3 or earlier.
    • 01: Up to 64 sockets can be assigned (firmware version must be higher than 3.3).
Gest_Index
Index of first word in Management_Param array
The following table describes the output parameters:
Parameter
Type
Comment
Socket_Number
Number of socket created if no error has occurred.
The following table describes the input/output parameters:
Parameter
Type
Comment
Management_Param
ARRAY [0... 3] OF INT
The operation report can have the following values:
  • 16#00: No error.
  • 16#37: The maximum number of sockets has been reached.