SysSockInetNtoa (FUN) ¶ FUNCTION SysSockInetNtoa : RTS_IEC_RESULT Convert IP address to a string. InOut: Scope Name Type Comment Return SysSockInetNtoa RTS_IEC_RESULT Runtime system error code (see CmpErrors.library). Input pInAddr POINTER TO INADDR Pointer to IP address description szIPADDR REFERENCE TO STRING Pointer to get IP address string (must be at least 16 bytes long) diIPAddrSize DINT Maximum length of szIPAddr
SysSockIoctl (FUN) ¶ FUNCTION SysSockIoctl : RTS_IEC_RESULT Io-control of a socket. InOut: Scope Name Type Comment Return SysSockIoctl RTS_IEC_RESULT Runtime system error code (see CmpErrors.library). Input hSocket RTS_IEC_HANDLE Handle to the socket diCommand DINT Io-control command pdiParameter POINTER TO DINT Parameter value of the command
SysSockListen (FUN) ¶ FUNCTION SysSockListen : RTS_IEC_RESULT Listen on a TCP server socket for new connection. InOut: Scope Name Type Comment Return SysSockListen RTS_IEC_RESULT Runtime system error code (see CmpErrors.library). Input hSocket RTS_IEC_HANDLE Handle to the socket diMaxConnections DINT Maximum number of connections allowed
SysSockNtohl (FUN) ¶ FUNCTION SysSockNtohl : UDINT Convert a UDINT value from ethernet byte order into host format. InOut: Scope Name Type Comment Return SysSockNtohl UDINT Converted UDINT value Input ulNet UDINT Ethernet value
SysSockNtohs (FUN) ¶ FUNCTION SysSockNtohs : WORD Convert a WORD value from ethernet byte order into host format. InOut: Scope Name Type Comment Return SysSockNtohs WORD Converted WORD value Input usNet WORD Ethernet value
SysSockPing (FUN) ¶ FUNCTION SysSockPing : RTS_IEC_RESULT Check the availability of the communication partner with a ping request. InOut: Scope Name Type Comment Return SysSockPing RTS_IEC_RESULT Runtime system error code (see CmpErrors.library): ERR_OK: Partner available ERR_FAILED: Partner cannot be reached All other results: Ping could not be sent because of other errors, so we don’t know, if the partner is available. Input szIPAddress REFERENCE TO STRING IP address of the communication partner as string ulTimeout UDINT Timeout in milliseconds to wait until reply pulReplyTime POINTER TO UDINT Pointer to get average reply time of the ping request in milliseconds
SysSockRecv (FUN) ¶ FUNCTION SysSockRecv : __XINT Receive data from a TCP socket. InOut: Scope Name Type Comment Return SysSockRecv __XINT Number of bytes received. 0 if failed. Input hSocket RTS_IEC_HANDLE Handle to the socket pbyBuffer POINTER TO BYTE Buffer to read data from the socket diBufferSize __XINT Maximum length of the buffer diFlags DINT The flags parameter can be used to influence the behavior of the function beyond the options specified for the associated socket. The semantics of this function are determined by the socket options and the flags parameter. The latter is constructed by using the bitwise OR operator with any of the SOCKET_MSG values. See category “Message flags”. pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)
SysSock2GetPeerName (FUN) ¶ FUNCTION SysSock2GetPeerName : RTS_IEC_RESULT Returns the socket address of the peer to which a socket is connected. The SysSockGetPeerName function can be used only on a connected socket. InOut: Scope Name Type Comment Return SysSock2GetPeerName RTS_IEC_RESULT Runtime system error code (see CmpErrors.library). Input hSocket RTS_IEC_HANDLE Handle to the socket pSockAddr POINTER TO SOCKADDRESS Socket address of the peer pdiSockAddrSize POINTER TO DINT Pointer to size of socket address structure
SysSock2GetSockName (FUN) ¶ FUNCTION SysSock2GetSockName : RTS_IEC_RESULT Returns the socket address of the local socket. Usally this function is called to retrieve the local socket address on multihomed hosts or to get the local port number in client implemntations. If the socket is neither connected nor locally bound to an address, the result of the function and the value stored in the object pointed to by pSockAddress is unspecified. InOut: Scope Name Type Comment Return SysSock2GetSockName RTS_IEC_RESULT Runtime system error code (see CmpErrors.library). Input hSocket RTS_IEC_HANDLE Handle to the socket pSockAddr POINTER TO SOCKADDRESS Socket address of the local socket pdiSockAddrSize POINTER TO DINT Pointer to size of socket address structure
SysSock2Htonl (FUN) ¶ FUNCTION SysSock2Htonl : UDINT Converts a value of type UDINT from host byte order to the order of the TCP/IP network. InOut: Scope Name Type Comment Return SysSock2Htonl UDINT Converted UDINT value Input ulHost UDINT Host value