AWSIoTPublish (FB)

FUNCTION_BLOCK AWSIoTPublish

Function block for publishing a message via AWS IoT Core.

InOut:

Scope

Name

Type

Comment

Input

xExecute

BOOL

Rising edge will publish the message |pbPayload|

udiTimeOut

UDINT

Time out in µs, 0: no time out

pbPayload

POINTER TO BYTE

Pointer to the message

udiPayloadSize

UDINT

Size of the message |pbPayload|

eQoS

QOS

Quality of service level (QoS)

mQTTPublishProperties

REFERENCE TO MQTTPublishProperties

Optional publish properties (MQTT V5 only)

Inout

awsIoTClient

AWSIoTClient

Reference to AWSIoTClient

wsTopic

WSTRING(1024)

Reference to the topic

Output

xError

BOOL

TRUE, if an error occurred

xBusy

BOOL

TRUE, while sending the message

xDone

BOOL

TRUE, if the message was sent successfully

eError

MQTT.MQTT_ERROR

Error code