WebSocketRead (FB)ΒΆ

FUNCTION_BLOCK PUBLIC FINAL WebSocketRead EXTENDS CBML.LConC

Function block to read incoming messages using the Common Behavior Model (e.g. for CFC applications).

Bemerkung

This function block OR the Write method of the WebSocketClient MUST be called in each cycle because the method also handles other requests in background (ping, pong etc.). Set xEnable to TRUE if xActive of the WebSocketClient is TRUE.

InOut:

Scope

Name

Type

Comment

Inherited from

Input

xEnable

BOOL

TRUE: Activates the defined operation FALSE: Aborts/resets the defined operation

LConC

Output

xBusy

BOOL

TRUE: Operation is running

LConC

xError

BOOL

TRUE: Error condition reached

LConC

Input

itfWebSocketClient

IWebSocketClient

Reference to the WebSocketClient

pData

__XWORD

Pointer to the payload data

udiSize

UDINT

Maximum size of the payload

Output

xReady

BOOL

TRUE if data received

udiCount

UDINT

Size of the received data

eFrameType

FRAME_TYPE

Type of the payload

xIsFinalFragment

BOOL

FALSE if the payload is incomplete and is sent via multiple packets. TRUE, if the payload is complete or if the payload was incomplete and this packet is the last packet of a message.