WebSocketWrite (FB)

FUNCTION_BLOCK PUBLIC FINAL WebSocketWrite EXTENDS CBML.ETrigTo

Function block to send messages to WebSocket server using the Common Behavior Model (e.g. for CFC applications).

InOut:

Scope

Name

Type

Initial

Comment

Inherited from

Input

xExecute

BOOL

Rising edge: Starts defined operation
FALSE: Resets the defined operation after ready condition was reached

ETrigTo

udiTimeOut

UDINT

Max. operating time for executing [µs], 0: No operating time limit

ETrigTo

Output

xDone

BOOL

Ready condition reached

ETrigTo

xBusy

BOOL

Operation is running

ETrigTo

xError

BOOL

Error condition reached

ETrigTo

Input

itfWebSocketClient

IWebSocketClient

Reference to the WebSocketClient

pData

__XWORD

Pointer to the payload data

udiSize

UDINT

Size of the payload

eFrameType

FRAME_TYPE

FRAME_TYPE.BINARY

Type of the payload data

Output

udiCount

UDINT

Number of sent bytes.

Bemerkung

It can take more than one cycles to send a message if the payload is greater than the maximum buffer size.