WebSocketClient.Read (METH)ΒΆ

METHOD Read : NBS.ERROR

Read incoming messages. If a message was received, then the message is copied to pData and xReceived is set to TRUE. udiCount corresponds to the size of the received data.

Note

This method MUST be called in each cycle because the method also handles other requests in background (ping, pong etc.). The method can be called directly OR via the function block WebSocketRead.

InOut:

Scope

Name

Type

Comment

Return

Read

NBS.ERROR

Input

pData

__XWORD

Pointer to the payload data

udiSize

UDINT

Maximum size of the payload

Output

udiCount

UDINT

Size of the received data

xReceived

BOOL

TRUE if data received

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.