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
SysSock2Htons (FUN) ¶ FUNCTION SysSock2Htons : WORD Converts a value of type short from order of the TCP/IP network to the host byte order. InOut: Scope Name Type Comment Return SysSock2Htons WORD Converted WORD value Input usHost WORD Ethernet value
SysSock2InetAddr (FUN) ¶ FUNCTION SysSock2InetAddr : RTS_IEC_RESULT Convert an IP address string into an IP address. InOut: Scope Name Type Comment Return SysSock2InetAddr RTS_IEC_RESULT Runtime system error code (see CmpErrors.library). Input szIPAddress REFERENCE TO STRING Pointer to get IP address string (must be at least 16 bytes long) pInAddr POINTER TO UDINT Pointer to IP address description
SysSock2InetNtoa (FUN) ¶ FUNCTION SysSock2InetNtoa : RTS_IEC_RESULT Convert IP address to a string. InOut: Scope Name Type Comment Return SysSock2InetNtoa 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
SysSock2Ioctl (FUN) ¶ FUNCTION SysSock2Ioctl : RTS_IEC_RESULT Io-control of a socket. InOut: Scope Name Type Comment Return SysSock2Ioctl 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