AWSIoTSubscribe (FB)¶
FUNCTION_BLOCK AWSIoTSubscribe
Function block to subscribe a topic.
- InOut:
Scope
Name
Type
Initial
Comment
Input
xEnableBOOLTRUE: Subscribes a topic (see |wsTopicFilter|), FALSE: Unsubscribe
pbPayloadPOINTER TO BYTE
Pointer to the receive buffer
udiMaxPayloadSizeUDINTMaximum size of the receive buffer
eQoSQuality of service level (QoS)
mQTTSubscribePropertiesREFERENCE TO MQTTSubscribeProperties
Subscribe proerties (MQTT V5 only)
udiTimeoutUDINT1000000
Time in µs in which an subcription acknowledgement (SUBACK) must be received.
Inout
awsIoTClientReference to AWSIoTClient
wsTopicFilterWSTRING(1024)Reference to the topic filter (‚+‘ and ‚#‘ are allowed)
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
wsLastTopicWSTRING(1024)Last received topic
mQTTPublishPropertiesLast received publish properties (MQTT V5 only)