Haiwell MQTT Agency Configuration Guide
Haiwell MQTT Agency Configuration Guide
Table of Contents
Important Statement..........................................................................................................................1
1. Network Diagram.........................................................................................................................3
2. Brief introduction.........................................................................................................................4
3. application scenario.....................................................................................................................4
quadratic configuration.........................................................................................................4
3.1 Configuration of HMI/CBOX for master.....................................................................4
3.2 Create HMI/CBOX/IPC project...................................................................................4
3.3 MQTT server...............................................................................................................5
3.4 Project downloading..................................................................................................6
3.5 Configuration of HMI for slaver..................................................................................6
3.6 Create a MQTT project...............................................................................................7
Data collecting and reporting into database........................................................................8
3.7 Project programming..................................................................................................8
3.8 Configuration of data interconnection tool.............................................................10
3.9 Verification................................................................................................................12
Important Statement
The application of MQTT apply to technicians who are proficient in database or MQTT. Hence, it is sorry that we
will not answer to the questions that are not related to PLC or SCADA. If you have any problem about database
or MQTT, please refer to related documents on internet.
1. Network Diagram
This guide aims to explain how to set up MQTT broker for purpose of achieving quadratic configuration on a
LAN. Reporting data and storing them in a database to achieve the remote data collection.
第 3 页 共 14 页
www.haiwell.com Haiwell(海为)HMI/CBOX/IPC MQTT Configuration Guide
2. Brief introduction
Haiwell IIOT Cloud HMI/CBOX support MQTT protocol and accessing database server to achieve reporting data
and docking ERP/MES system.
Haiwell IIOT Cloud HMI/CBOX built-in MQTT server to achieve MQTT agency.
Hint: It can only be able on a LAN, and only HMI/CBOX support this function.
3. Application scenario
Quadratic configuration
3.1 Configuration of HMI/CBOX for master
Enter into HMI/CBOX background-setting-others, open the MQTT agency.
When the MQTT agency has been opened, the current HMI/CBOX is equivalent to a MQTT server. The server IP
is the device local IP. At the same time, other device (HMI/CBOX/IPC) on a same LAN as this device can report
data using the device as a MQTT server.
第 4 页 共 14 页
www.haiwell.com Haiwell(海为)HMI/CBOX/IPC MQTT Configuration Guide
Apply channels in the pop-up window. Tick on ‘Enable report MQTT’ in storage mode. In this case, the ‘switch’
and ‘value’ will be recorded and uploaded. Hence, the channels applied will be ‘switch’ and ‘value’. If tick on
‘Enable remote write’, these variables can be written remotely. Notice the group identifier and channel
identifiers which will be used in the following MQTT project.
第 5 页 共 14 页
www.haiwell.com Haiwell(海为)HMI/CBOX/IPC MQTT Configuration Guide
The terminal name and terminal code also can be setting by system variable, which are $TerminalName,
$TerminalCode. Add graphics in display and bind these two variables.
第 6 页 共 14 页
www.haiwell.com Haiwell(海为)HMI/CBOX/IPC MQTT Configuration Guide
第 7 页 共 14 页
www.haiwell.com Haiwell(海为)HMI/CBOX/IPC MQTT Configuration Guide
第 8 页 共 14 页
www.haiwell.com Haiwell(海为)HMI/CBOX/IPC MQTT Configuration Guide
Add channel variable in the pop-up window. It’s necessary to tick on ‘Enable Report MQTT’. The added variable
in this guide is ‘switch’,’value’. There are three levels of reporting service quality.
At most once Qos0: The message is sent only once, but it is not received.
At least once Qos1: The message is received at least once, but it may be sent multi times.
For once Qos2: The message is sent and received only once.
The group identifiers correspond to the table names of the database, the channel identifiers correspond to the
field of the table of the database. It’s not necessary to build tables and fields ahead.
第 9 页 共 14 页
www.haiwell.com Haiwell(海为)HMI/CBOX/IPC MQTT Configuration Guide
第 10 页 共 14 页
www.haiwell.com Haiwell(海为)HMI/CBOX/IPC MQTT Configuration Guide
第 11 页 共 14 页
www.haiwell.com Haiwell(海为)HMI/CBOX/IPC MQTT Configuration Guide
3.9 Verification
MySQL Database
Remotely access MySQL server via MySQL-front, click the database named base1. As we can see, it’s a table
named group1. Double click the table(group1) and select data browser, the value and switch are stored in the
database and constantly update. Hence the historical data of HMI/CBOX/IPC are already stored in the MySQL
database
第 12 页 共 14 页