Web Socket Client SL Library Documentation ¶ Company : CODESYS Title : Web Socket Client SL Version : 1.10.0.0 Categories : Application|Utils Namespace : WEB_SOCKET Author : CODESYS Development GmbH Placeholder : Web_Socket_Client_SL Description [ 1 ] ¶ The WebSocket protocol enables two-way communication between a client and a remote host over the internet. The WebSocket protocol enables interaction between a web client and a web server with lower overhead than half-duplex alternatives such as HTTP polling. The communication is usually done over TCP port number 443 (or 80 in the case of unsecured connections). The function block WebSocketClient is used to connect a client to a server and for reading and writing messages via the methods Read and Write . The function blocks WebSocketRead and WebSocketWrite can be used for reading and writing messages using the Common Behavior Model (e.g. for CFC applications). Contents: ¶ Library Information GetLibVersion (Function) GetLibVersionNumber (Function) IsLibReleased (Function) Web Socket Client SL Enums Function Blocks Interfaces Structs Indices and tables ¶ [ 1 ] Based on Web Socket Client SL.library, last modified 06.05.2024, 08:29:44. LibDoc 4.5.0.0 The content file Web Socket Client SL.clean.json was generated with CODESYS V3.5 SP16 Patch 3 on 06.05.2024, 08:29:46.
Library Information ¶ GetLibVersion (Function) GetLibVersionNumber (Function) IsLibReleased (Function)
GetLibVersion (FUN) ¶ FUNCTION GetLibVersion : VERSION This function has been automatically generated from the project information. InOut: Scope Name Type Return GetLibVersion VERSION
GetLibVersionNumber (FUN) ¶ FUNCTION GetLibVersionNumber : DWORD This function has been automatically generated from the project information. InOut: Scope Name Type Return GetLibVersionNumber DWORD
IsLibReleased (FUN) ¶ FUNCTION IsLibReleased : BOOL This function has been automatically generated from the project information. InOut: Scope Name Type Return IsLibReleased BOOL
Web Socket Client SL ¶ Enums ERROR (Enum) FRAME_TYPE (Enum) Function Blocks WebSocketClient (FunctionBlock) Read (Method) SetInitialValue (Method) Write (Method) WebSocketRead (FunctionBlock) WebSocketWrite (FunctionBlock) Interfaces IWebSocketClient (Interface) Read (Method) Write (Method) Structs HttpProxySettings (Struct)
Enums ¶ ERROR (Enum) FRAME_TYPE (Enum)
ERROR (ENUM) ¶ TYPE ERROR : WebSocket client errors Attributes: qualified_only InOut: Name Initial Comment NO_ERROR 0 No error TIME_OUT 1 Time out INVALID_LICENSE 2 No valid license found or demo mode has expired. URI_PARSE_ERROR 3 Error while parsing the uri RESOLVE_HOSTNAME_FAILED 4 Can not resolve hostname CONNECTION_REFUSED 5 Connection refused by server TLS_CONTEXT_ERROR 6 Error while creating the TLS context TCP_INIT_ERROR 7 TCP Init error SEND_OPENING_HANDSHAKE_ERROR 8 Error while sending handshake RECEIVE_OPENING_HANDSHAKE_ERROR 9 Error while receiving handshake TCP_ERROR 10 TCP error while client is connected to server FRAME_PARSE_ERROR 11 Error while parsing the frame PONG_ERROR 12 Error while sending the pong request PING_ERROR 13 Error while sending the ping request PING_TIMEOUT 14 Ping timeout, no pong request from server received PAYLOAD_POINTER_IS_NULL 15 The payload pointer is null, although the payload size is greater than 0 CAN_NOT_ALLOCATE_BUFFERS 16 Error while allocating buffers CONNECTION_CLOSED_BY_SERVER 17 The connection has been closed by the server MAX_PAYLOAD_SIZE_EXCEEDED 18 The maximum size of the payload data was exceeded RECEIVED_MASKED_SERVER_FRAME 19 Received a unexpected masked server frame PROXY_CONNECTION_REFUSED 20 Connection refused by proxy SEND_PROXY_CONNECT_ERROR 21 Error while sending connection handshake to proxy RECEIVE_PROXY_CONNECT_ERROR 22 Error while receiving connection handshake from proxy UPGRADE_CONNECTION_NOT_SUPPORTED 23 Upgrade connection not support, needs Net Base Services V3.5.17.0 PENDING 24 The current action is in pending state
FRAME_TYPE (ENUM) ¶ TYPE FRAME_TYPE : Type of the frame Attributes: qualified_only InOut: Name Initial Comment TEXT 16#1 The payload contains a text message BINARY 16#2 The payload contains a binary message
ConvertUTF8toUTF16 (FUN) ¶ FUNCTION ConvertUTF8toUTF16 : UDINT Converts a STRING to WSTRING. InOut: Scope Name Type Comment Return ConvertUTF8toUTF16 UDINT Input sourceStart POINTER TO BYTE Pointer to STRING targetStart POINTER TO WORD Pointer to WSTRING dwTargetBufferSize DWORD Size of the WSTRING bStrictConversion BOOL