MQTT Subscribe
This function block is designed to subscribe to a specified MQTT topic and receive messages. It allows you to integrate MQTT communication within your application seamlessly.
📥 Inputs
Enable
This boolean input enables or disables the MQTT subscription.
📤 Outputs
Data
This output provides the latest message received on the subscribed MQTT topic.
New Data
A boolean output that indicates whether new data has been received since the last evaluation.
🕹️ Controls
MQTT Topic Input
A field where the user can specify the topic to which this block wants to subscribe.
Reconnect
A toggle or button that allows the user to reconnect to the MQTT broker with updated settings.
🎨 Features
Real-Time Messaging
The block continuously listens for messages on the specified MQTT topic and updates outputs in real time.
Dynamic Subscription Management
The block can handle changes in subscription parameters, allowing for dynamic adjustments without reconnecting.
Connection Status Logging
Information about connection status and received messages is logged, aiding in debugging and monitoring.
📝 Usage Instructions
Enter MQTT Topic: Specify the MQTT topic in the
MQTT Topic Input
field.Enable Subscription: Connect a boolean signal to the
Enable
input to allow or disallow subscription.Receive Messages: The latest messages will be provided through the
Data
output, and theNew Data
output will indicate if new messages have been received since the last evaluation.Cleanup: When finished, the block will automatically disconnect from the MQTT broker when removed or deactivated.
📊 Evaluation
On each evaluation cycle, this function block checks if data has been received, returning the newest message along with a flag indicating whether it is new.
💡 Tips and Tricks
🛠️ Troubleshooting
Last updated