5 CHECKING OPERATIONS
5.2 Checking the Operation of Subscribe (Sending of Subscribe Command)
44
5
5.2 Checking the Operation of Subscribe (Sending of
Subscribe Command)
Use M+FX5ENET_MQTT_Subscribe (Sending of Subscribe command) for sending a SUBSCRIBE/UNSUBSCRIBE
command to the server (MQTT broker).
Program
M27 turns on for setting the information used for M+ENET_MQTT_Subscribe (Sending of Subscribe command).
M29 (Execution command) turns on. After M23 (Execution status) turns on, M21 (SUBSCRIBE instruction) turns on for
sending the SUBSCRIBE command.
After the Subscribe is successfully sent, M26 (Send completion) turns on.
(1) FX5U CPU module
(2) FX5-ENET
M+FX5ENET_MQTT_Subscribe
(1) (2)
FB
Subscribe
AWS
MOV
MOV
M27
MOV
MOV
K1 D10
D11
D12
D13
K0
K0
K600
Set subscribe ID to K1.
Set the maximum QoS to K0.
Set the topic message format to K0.
Set the Subscribe topic name start address to K600.
o_bErr :B
o_bOK :B
o_bENO :B
DUT: i_stModule
B: i_bEN
o_uErrId :UW
o_bSendOK :B
o_uConnectionStatus :UW
M23
M29
M24
M25
UW: i_uConnectionNo
B: i_bSubscribe
B: i_bUnSubscribe
UW: i_uSubscribeId
UW: i_uMaxQoS
UW: i_uTopicMessageFormat
UW: i_uSubscribeTopicNameDataAddr
M_FX5ENET_MQTT_Subscribe_00A_1
(M+FX5ENET_MQTT_Subscribe_00A)
M26
D14
FX5ENET_1
D11
D12
D10
D0
D15
M22
D13
M21
MQTT Subscribe FB
Subscribe ID: K1
Topic message format: K0
Subscribe topic name data start address: K600
Connection number: K1
Maximum QoS: K0