FCT_SEND: Sending Data to a Specified Socket
(Original Document)
Function Description
The FCT_SEND function is used to send data to a foreign socket. The maximum length of data to send is 240 bytes.
NOTE: it is not possible to send out of band data.
The additional parameters EN and ENO may be configured.
Representation in FBD
Representation in LD
Representation in IL
LD Module_Number
FCT_SEND Socket_Number, Pbuf_Index, Gest_Index,Data_to_Send, Management_Param
Representation in ST
FCT_SEND(Module_Number, Socket_Number, Pbuf_Index, Gest_Index,Data_to_Send, Management_Param);
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).
Socket_Number
Socket number
Pbuf_Index
Index of first word in Pbuf_Address array
Gest_Index
Index of first word in Management_Param array
Data_to_Send
ARRAY [0... n] OF INT
Array of a maximum of 120 words containing the data to be sent
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#09: The socket number is invalid.
  • 16#20: Communication is broken.
  • 16#23: The socket is full.
  • 16#36: The connection has been reset by peer.
  • 16#39: The socket is not connected (listening socket).
  • 16#0E: The length of the character string to be sent is greater than 240 bytes.
The fourth word of the array should contain the number of bytes sent if no error has occurred.