MQTT (Message Queuing Telemetry Transport) is an ISO standard (ISO/IEC PRF 20922) messaging protocol using a publish-subscribe pattern. It operates over the TCP/IP protocol suite and can maintain device communication even with poor hardware performance of remote devices or unstable network conditions, making it widely applicable in various fields. As a publish-subscribe-based messaging protocol, MQTT requires a message middleware, i.e., the MQTT Broker server. Please make sure that a suitable operating environment has been set up before proceeding.
Note:
1. The MQTT data sharing feature does not require separate authorization.
2. The SOLISCADA software does not include built-in deployment of an MQTT Broker server. You have to install and deploy it by yourself.
In SOLISCADA, the SCADA system can subscribe to data published by third-party MQTT using the Database-MQTT Driver, and it can also publish data through MQTTClient for third-party clients to read.
Subscribing to the Data Published by Third-party MQTT using the MQTT Driver
Tags created under the driver are read-only and values cannot be written to them.
Forwarding SCADA Real-time Data, Historical Data, and Alarm Data using the MQTT Service
Support forwarding SCADA real-time data and allow third parties to modify SCADA tag values in real time.
Allow third parties to query historical data.
Allow third parties to subscribe to real-time alarm notifications and query historical alarm records.
2.1 Subscribing to the Data using the MQTT Driver
With the MQTT driver, the current client can connect to the MQTT service (MQTT Broker server) to receive real-time messages published to the MQTT server by other clients. Tags created under the driver are read-only and values cannot be written to them.
You can subscribe to relevant topics on the server by configuring topic names and display specified data from the messages by configuring tags.
2.1.1 Driver Configuration
Add the MQTT driver in Database-Local Node, then right-click the driver to enter the driver configuration page and add clients and Topics.
In the client configuration page, fill in the address and port number of the MQTT Broker server, client ID, username, and password. (Configure client ID, username, and password according to the broker server's requirements, or use the default configurations.)
In the Topic configuration page, enter the topic under which third-party clients publish data. The SCADA subscription topic must match the third-party publication topic.
2.1.2 Adding Tags
Right-click the driver to add tags, then select the tag type and I/O address.
Keep the I/O address type and data address synchronized with the message content.
Attention:
Currently, values cannot be written to tags subscribed using the MQTT driver.
2.1.3 Data Address Configuration Example
In addition to the single-level JSON type configured in 2.1.2, the SCADA software also supports other JSON types, as shown in the figure below.
The payload data address is the data address when adding SCADA tags.
2.2 Forwarding the Data using the MQTT Service
SOLISCADA supports publishing real-time data, historical data, and alarm information externally via the MQTT protocol, and also allows modification of real-time data.
After launching InPlant SCADA monitoring, configuring MQTTClient parameters, and successfully establishing a connection, the software can push data to the MQTT Broker server through MQTTClient for third-party clients to subscribe to.
2.2.1 Enabling the MQTT Forwarding Service in Global Settings
On the project management page, check "MQTT Data Forwarding Service" under the tab "Startup" of Global Settings. After publishing the project, launch the monitoring software.
2.2.2 MQTTClient Configuration
After starting monitoring and logging in, right-click the icon in the system tray, and select "Properties" to open MQTTClient.
Configure service parameters: Enter the address and port number of the MQTT broker server, client ID, username, password, etc. Select "Other(Json)" and then start it.
After starting, the status shows "Connected".
Configure general properties: MQTT version (recommended to remain the default) and push method.
2.2.3 Real-time Data Topics
2.2.3.1 Third Parties Subscribe to Real-time Values
When a third-party client wants to obtain real-time values of tags from the SCADA local real-time database, it needs to subscribe to the "Publication Topic".
l Check "All Tags" and set the topic name. When third-party clients subscribe to the topic, they will receive real-time data of all tags.
l If you only want to allow data of some specific tags to be accessed, check "Custom Open Bit Number" and then configure the topics and the list of tags that can be accessed: ① click "Add" to add a new topic with the default name "Topic+Number"; ② select a topic and click "Rename" to modify the topic name (it can contain English letters, digits, and underscores with up to 32 characters); ③ select a topic and click "Add" on the right to select the tags to be subscribed to in the tag selector. Note: Different subscription topics can include the same tags.
2.2.3.2 Third Parties Publish Modified Values
When a third-party client wants to modify the real-time values of tags in the SCADA local real-time database, it needs to publish the "Subscription Topic".
Subscription Topic: When a tag's read-write attribute is set to read-write, third-party clients can write values to the tag via MQTTClient.
Note: Currently, values cannot be written to tags subscribed using the MQTT driver as described in Section 2.1 (these tags are read-only).
2.2.3.3 Third Parties Subscribe to Real-time Values: Custom Format Fields
When third-party clients retrieve real-time values of tags from the SCADA local real-time database, in addition to the default JSON format, they can also customize simple format fields.
To modify the message format, locate the configuration file MQTTRTDataJsonSchema.conf in the project runtime directory (default path: D:\ECSRun\ProjectName\HMI\SubProject\Run). This file does not exist by default—it is generated upon the first startup by default or can also be created manually. After modification, restart the MQTT service in the software.
Custom Format 1: Single-level JSON
Custom Format 2: Multi-level JSON
Custom Format 3: Single-level JSON Array
2.2.4 Historical Data Query Topic
When querying historical data, third-party clients need to send a query message to the MQTT service. A new message must be sent for each query. Upon successful query, the latest historical data can be retrieved. Each query can fetch data of up to 8 tags, with a maximum of 5,000 data points per tag.
When third-party clients send/receive data using the MQTT communication, they must adhere to the specified format.
Third-party Clients Publish: Subscribe to Query Historical Data
Configure parameters including: tag names to query, time range, time interval, topic to receive, etc.
Third-party Clients Subscribe: Receive Historical Data
2.2.5 Alarm Topics
After subscribing to the corresponding topic for real-time alarms, third-party clients can receive real-time alarm messages; after sending historical alarm query messages, they can obtain historical alarm data. The obtained alarm information does not include event alarms.
2.2.5.1 Subscribing to Real-time Alarm Messages
After a third-party client sends a subscription message once, the MQTT service will push real-time alarm data to the client; after sending an unsubscription message once, the MQTT service will stop sending real-time alarm data.
Third-party Clients Publish: Subscribe to Alarm Messages
Subscribe to alarm messages via the topic "11".
Third-party Clients Subscribe: Receive Alarm Messages
2.2.5.2 Subscribing to Query Historical Alarm Messages
When querying historical alarms, a new query message must be sent for each query. Upon successful query, the latest historical data can be obtained. A single query can retrieve up to 10,000 alarms; a maximum of 1,000 alarms can be pushed each time, and if exceeded, they will be pushed in batches.
Third-party Clients Publish: Subscribe to Historical Alarm Messages
Third-party Clients Subscribe: Receive Historical Alarm Messages
For detailed manual instructions, please refer to the help document of the SCADA software.
3.1.1.1 MQTT Driver
3.1.1.2 MQTT Forwarding