SendMQTTMessage (FB)¶
FUNCTION_BLOCK SendMQTTMessage
Function block for sending D2C messages via MQTT to Azure IoT Hub.
- InOut:
Scope
Name
Type
Comment
Input
xExecuteBOOLRising edge will send the message |pbPayload|
udiTimeOutUDINTTime out in µs, 0: no time out
pbPayloadPOINTER TO BYTE
Pointer to the message
udiPayloadSizeUDINTSize of the message |pbPayload|
sPropertyBagSTRINGProperty bag (optional) Example: RFC 2396-encoded(<PropertyName1>)=RFC 2396-encoded(<PropertyValue1>)&RFC 2396-encoded(<PropertyName2>
Inout
azureMQTTClientReference to AzureMQTTClient
Output
xErrorBOOLTRUE, if an error occurred
xBusyBOOLTRUE, while sending the message
xDoneBOOLTRUE, if the message was sent successfully
eErrorMQTT.MQTT_ERRORError code