One 、MQTT summary
MQTT Protocol is a message queuing transmission protocol , Adopt subscription 、 Publishing mechanism , Subscribers receive only the data they have subscribed to , Non subscription data will not be received , It ensures the necessary data exchange , It also avoids the storage and processing caused by invalid data . Therefore, it has been widely used in the industrial Internet of things .
Be careful : It can be seen from the picture that ,MQTT There were : Publisher 、 subscriber 、 The server . If you are interested, you can go to MQTT Chinese net understand .
Two 、MQTT Project Download
because NI The company has not yet released MQTT modular , So we can only use open source projects for testing , Of course, the little friend can also according to MQTT The agreement TCP Write on the basis of communication .
Here I will test it with an open source project ,github Download address :https://github.com/cowen71/mqtt-LabVIEW, Will use GitHub You can download according to the download address , Here I download it in the form of a compressed package , As shown in the figure below :

3、 ... and 、 Open the project
Double click the project file to open , As shown in the figure below :

Open the test program . As shown in the figure below :

Enter the test program , As shown in the figure below :

Four 、 Project use
The interface required by the test program is as follows :
All my friends know that , Connect MQTT service , You need to know about the server IP And port , So in LabView Configure... In the test program IP And port are shown in the following figure :
5、 ... and 、MQTT The server
MQTT The server is used in many ways , For example, you can set up a server by yourself MQTT platform , You can also directly use the public platform for testing ( For example, Tencent cloud 、 Alicloud, etc ).
No account has been registered on the cloud platform , So here I use mosquitto Software , A local one MQTT The server , of mosquitto The software can be browsed mosquitto Use and common configurations .
6、 ... and 、 test
start-up MQTT The server , As shown in the figure below :

Use mosquitto subscribe "a/b" The theme , The following figure shows the successful subscription :

Use LabView Release data

Use LabView Subscription data

Use mosquitto Release data

As can be seen from the above results ,LabView Of MQTT There is no problem with project testing , So you can study it carefully , Of course, you should pay attention to the copyright of others when using open source projects , As shown in the figure below :
reference
MQTT agreement :https://baike.baidu.com/item/MQTT agreement /56980070?fr=aladdin
Labview adopt MQTT Protocol publish and subscribe messages :https://wenku.baidu.com/view/0daf4e2c5b1b6bd97f192279168884868762b83a.html









