Mitsubishi Electric MELSEC iQ-F Series User Manual page 57

Hide thumbs Also See for MELSEC iQ-F Series:
Table of Contents

Advertisement

■Receiving messages from a broker (Subscribe)
FX5 CPU module
(ladder program)
PUBLISH message subscribing start
FB: MQTT_Receive
FB: MQTT_Receive
i_bEN=OFF→ON
i_bEN=OFF→ON
FB: MQTT_Receive: output
FB: MQTT_Receive: output
o_bOK=ON
o_bOK=ON
SUBSCRIBE request
FB: MQTT_Subscribe
FB: MQTT_Subscribe
i_bSubscribe=OFF→ON
i_bSubscribe=OFF→ON
FB: MQTT_Subscribe: output
FB: MQTT_Subscribe: output
o_bOK=ON
o_bOK=ON
FB: MQTT_Receive: output
FB: MQTT_Receive: output
o_bReceived=ON
o_bReceived=ON
Subscribing processing
FB: MQTT_Receive: output
FB: MQTT_Receive: output
o_bReceived=ON
o_bReceived=ON
Subscribing processing
UNSUBSCRIBE request
FB: MQTT_Subscribe
FB: MQTT_Subscribe
i_bUnSubscribe=OFF→ON
i_bUnSubscribe=OFF→ON
FB: MQTT_Subscribe: output
FB: MQTT_Subscribe: output
o_bOK=ON
o_bOK=ON
As a subscriber, the MQTT client uses FB: MQTT_Subscribe to send a broker the SUBSCRIBE command to request a topic
to subscribe. The broker returns the SUBACK command to the subscriber. When the requested topic matches a topic in the
PUBLISH command received from publishers, the broker uses the PUBLISH command to send the topic name and data to
the subscriber.
The MQTT client uses FB: MQTT_Receive to get the received PUBLISH command.
To cancel a subscription, the subscriber uses the UNSUBSCRIBE command to send the broker the topic name to
unsubscribe. The broker returns the UNSUBACK command to the subscriber. The broker no longer sends the PUBLISH
command to the subscriber even if receiving the PUBLISH command with a topic that matches the unsubscribed topic.
Ethernet module
SUBSCRIBE (Topic)
SUBSCRIBE (Topic)
SUBACK
SUBACK
PUBLISH (Topic, Data)
PUBLISH (Topic, Data)
PUBLISH (Topic, Data)
PUBLISH (Topic, Data)
UNSUBSCRIBE (Topic)
UNSUBSCRIBE (Topic)
UNSUBACK
UNSUBACK
Cloud
Broker
PUBLISH (Topic, Data)
PUBLISH (Topic, Data)
*QoS=0
*QoS=0
PUBLISH (Topic, Data)
PUBLISH (Topic, Data)
*QoS=0
*QoS=0
PUBLISH (Topic, Data)
PUBLISH (Topic, Data)
PUBLISH
PUBLISH
*QoS=0
*QoS=0
IoT
Device
Publisher
4 FUNCTION LIST
55
4.3 Other Functions
4

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec iq-f fx5-enetFx5-u-enet-e09r736

Table of Contents