FCT_SELECT: Multiplexes Requests Over Sockets
(Original Document)
Function Description
The FCT_SELECT function is used to multiplex I/O requests among multiple sockets. It indicates which sockets have events to process using an array of integers.
For ETY 5103 firmware revision 3.3 or lower:
For ETY 5103 firmware greater than revision 3.3:
NOTE: For versions higher than 3.3, a length parameter is required in the Management_Param structure.
The length field is not used when the high byte of the INTE parameter is set to 00. You should set the length to 8 when the high byte of the INTE parameter is set to 01. A setting of 8 allows you to see the data associated with all 64 connections. If you set the value lower, say to 4, you will see only the data associated with the first 32 connections.
The additional parameters EN and ENO may be configured.
Representation in FBD
Representation in LD
Representation in IL
LD Module_Number
FCT_SELECT Mask_Index, Gest_Index, Management_Param, Socket_Activity
Representation in ST
FCT_SELECT(Module_Number, Mask_Index, Gest_Index, Management_Param, Socket_Activity);
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 used (firmware version must be higher than 3.3).
Mask_Index
Index of first word in the Socket_Activity array
Gest_Index
Index of first word in Management_Param array
The following table describes the input/output parameters:
Parameter
Type
Comment
Management_Param
ARRAY [0... 3] OF INT
For this function, the operation report always returns the value 16#00 indicating that no error has occurred.
The following table describes the output parameters:
Parameter
Type
Comment
Socket_Activity
ARRAY [0... 1] OF INT
- or -
ARRAY [0... 3] OF INT (Refer to the note in the Function Description topic.)
Status of each socket. Each bit set to 1 indicates an event on the socket which corresponds to this bit. For example:
For version 3.3 or earlier:
  • If bit 5 of the first word has the value 1, socket 6 will be read by the FCT_ACCEPT function.
  • If bit 3 of the second word has the value 1, socket 20 will be read by the FCT_RECEIVE function.
For versions later than 3.3:
  • If a bit is set to 1 on a listening socket, a server is ready to accept this connection. If a bit is set to 1 on a connected socket, data is ready to be sent or communication has been interrupted.
Client Perspective: Once you have a client connection, the corresponding bit for the connection (socket number) is set to 1 in the array. Example: Socket 33 will be found in the third word, first bit (bit 0).
Server Perspective: The listening function opens a socket. This socket number has a corresponding bit set to 1 in the array. Example: Socket 3 will be found in the first word, third bit (bit 2). Then, the Accept function will return a different socket number, and this socket number will have a corresponding bit set to 1 in the array.
NOTE: The listening function socket number bit will remain set to 1 until the socket is closed.