SendMQTTMessage (FB)¶
FUNCTION_BLOCK SendMQTTMessage
Function block for sending D2C messages via MQTT to Azure IoT Hub.
- InOut:
Scope
Name
Type
Initial
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|
sPropertyBagSTRING(Param.g_uiPropertyBagLength)Property bag (optional) Example: RFC 2396-encoded(<PropertyName1>)=RFC 2396-encoded(<PropertyValue1>)&RFC 2396-encoded(<PropertyName2>
eMqttQoSMQTT_QOS.QoS1
The QoS used in MQTT message
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