SysFileOpen (FUN) ¶ FUNCTION SysFileOpen : DWORD InOut: Scope Name Type Comment Return SysFileOpen DWORD Inout Const FileName STRING Mode STRING(20) Use ‘w’ (write), ‘r’ (read) or ‘rw’ (read and write)
SysFileRead (FUN) ¶ FUNCTION SysFileRead : DWORD InOut: Scope Name Type Comment Return SysFileRead DWORD Input File DWORD Buffer DWORD Address (ADR) to Buffer Size DWORD
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)
SysSockRecvFrom (FUN) ¶ FUNCTION SysSockRecvFrom : __XINT Receive a message from a connectionless socket (UDP). NOTE: With some IP stacks (LwIP for example, which is used with the CODESYS Control RTE), it is necessary to set the SOCKET_SO_BROADCAST socket option (SOCKET_SOL level) in order to be able to receive broadcast UDP messages with the SysSockRecvMsg() and SysSockRecvFrom() functions. InOut: Scope Name Type Comment Return SysSockRecvFrom __XINT Number of bytes received 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. pSockAddr POINTER TO SOCKADDRESS Socket address and port to receive data from diSockAddrSize DINT Size of socket address structure pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)
SysSockRecvFromUdp (FUN) ¶ FUNCTION SysSockRecvFromUdp : __XINT Receive a paket from a UDP socket. InOut: Scope Name Type Comment Return SysSockRecvFromUdp __XINT Number of bytes received Input hSocketUdp RTS_IEC_HANDLE Handle to the UDP socket pbyData POINTER TO BYTE Pointer to data to receive diDataSize __XINT Size of data to receive pReply POINTER TO UDP_REPLY Description of the client that has sent this paket pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)
SysSockRecvFromUdp2 (FUN) ¶ FUNCTION SysSockRecvFromUdp2 : __XINT Receive a paket from a UDP socket. InOut: Scope Name Type Comment Return SysSockRecvFromUdp2 __XINT Number of bytes received Input hSocketUdp RTS_IEC_HANDLE Handle to the UDP socket pbyData POINTER TO BYTE Pointer to data to receive diDataSize __XINT Size of data to receive pReply POINTER TO UDP_REPLY2 Description of the client that has sent this paket pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)