MQTT Client Subscribe
Libraries:
Industrial Communication Toolbox /
MQTT
Description
The MQTT Client Subscribe block subscribes to MQTT topics specified in the Topics to subscribe parameter. The block reads messages from these topics and returns the messages at the corresponding output ports. The read operation takes place synchronously at the specified sample time.
The IsNew port outputs a Boolean value or vector of Boolean values depending on the number of subscribed topics. The Boolean values indicate if a new message is available in the corresponding topic.
Note
You need a license for Industrial Communication Toolbox™ and Simulink® to use this block.
Note
You must associate the MQTT Client Subscribe block with an MQTT Client. You can create the client to connect to the MQTT broker using the MQTT pane in the Configuration Parameters dialog box of the model. You must add at least one MQTT Client Subscribe or MQTT Client Publish block in the model to enable this pane. For more information, see Configure MQTT Client in Simulink.
Examples
Limitations
Each MQTT Client Subscribe block in a model must be associated with a unique MQTT client. Industrial Communication Toolbox does not support using the same MQTT client for multiple MQTT Client Subscribe blocks within a model.
Ports
Output
Parameters
Version History
Introduced in R2025a