SubscribeMQTTMessage (FB)ΒΆ
FUNCTION_BLOCK SubscribeMQTTMessage
Function block to read C2D messages from Azure IoT Hub via MQTT.
- InOut:
Scope
Name
Type
Initial
Comment
Input
xEnableBOOLTRUE: Subscribes C2D messages
pbPayloadPOINTER TO BYTE
Pointer to the receive buffer
udiMaxPayloadSizeUDINTMaximum size of the receive buffer
eMqttQoSMQTT_QOS.QoS1
The QoS used in MQTT message
Inout
azureMQTTClientReference to AzureMQTTClient
Output
xErrorBOOLTRUE, if an error occurred
xBusyBOOLTRUE, while the topic is subscribed
eErrorMQTT.MQTT_ERRORError code
xReceivedBOOLTRUE, if a message has been received (see |pbPayload|).
udiPayloadSizeUDINTLength of the received message
xSubscribeActiveBOOLFALSE
FALSE: When there is no active subscription, TRUE: Subscriber is listening