Delta HMI MQTT JSON Function Application Example

1. Introduction

MQTT is a lightweight, simple, and effective communication protocol that facilitates communication between Internet of Things (IoT) devices. It is widely adopted in various IoT applications. MQTT operates on a Publish/Subscribe model. A Publisher disseminates information on a specific Topic, and a Subscriber can receive related information by subscribing to that topic. When a Publisher sends a new message, the Broker (acting as a middleman) forwards the message to all Subscribers subscribed to that topic. Subscribers can then receive different messages based on their subscriptions.

Diagram Description: Illustrates the MQTT Publish/Subscribe model. A Publisher sends a 'Package' to a 'Broker'. The Broker then forwards this package to 'Subscribers' based on their subscriptions to 'Topic A' or 'Topic B'. A note indicates that subscribers must subscribe before receiving messages.

2. Scenario

Given the prevalence of numerous MQTT platforms with varying formats, Delta HMI has developed a method to interpret MQTT packets, enabling users to define their own data structures. This article utilizes DOP-3S10S3E2 as the Publisher, DOP-3S07S3E2 as the Broker, and a PC running MQTT software as the Subscriber.

3. Hardware/Software Configuration

Hardware:

No.DeviceTypeQuantity
1PCWindows 10 Enterprise version 22H21
2HMI*2DOP-3S07S3E2
DOP-3S10S3E2
1
3CableRJ451

Software:

No.DeviceTypeQuantity
1MQTTVersion 1.10.11
2HMI editing softwareDIAScreen1

Software version: DIAScreen 1.4.2.41 or above

Firmware version: Ver-1.0132.6.1 or above

MQTT Client software: Recommended to use MQTT.fx v1.7.1

MQTT.fx download: https://www.softblade.de/download/

Architecture Description: A network diagram illustrates the setup. DOP-3S10S3E2 (MQTT Publisher) with IP 192.168.123.154 and DOP-3S07S3E2 (MQTT Broker) with IP 192.168.123.155 are connected via RJ45 to a switch (交換機). A PC (MQTT Subscriber) with IP 192.168.123.30 is also connected to the switch, forming a Local Area Ethernet.

4. Operational Steps

This section details how the HMI communicates using the MQTT protocol with MQTTX, displaying custom JSON formats. The setup involves DOP-3S10S3E2 as the Publisher, DOP-3S07S3E2 as the Broker, and a PC's MQTTX as the Subscriber.

Wiring

The MQTT communication protocol is based on TCP/IP. Publishers, Brokers, and Subscribers can exchange data via IP as long as they are within the same network domain. This example connects the Publisher (DOP-3S10S3E2), Broker (DOP-3S07S3E2), and Subscriber (PC) using an RJ45 network cable to implement the MQTT function.

Diagram Description: Similar to the architecture diagram, this shows DOP-3S10S3E2 (MQTT Publisher, 192.168.123.154), DOP-3S07S3E2 (MQTT Broker, 192.168.123.155), and PC (MQTT Subscriber, 192.168.123.30) connected via RJ45 and a switch within a Local Area Ethernet.

Create Broker project (DOP-3S07S3E2)

1. Set Broker information: Open DIAScreen and configure the HMI as an MQTT Broker.

Description of DIAScreen Interface: Shows the MQTT settings window for configuring the HMI as an MQTT Broker. Key settings include enabling the Broker server, specifying a Broker name, and setting the Port to 1883.

Set the HMI IP (MQTT Publisher/Broker/Subscriber must be in the same domain).

Description of HMI IP Settings in DIAScreen: Displays the communication settings for the HMI. Users can set the HMI IP address (e.g., 192.168.123.155), Subnet Mask, Default Gateway, and DNS Server IP address.

Create Publisher project (DOP-3S10S3E2)

1. Set Broker connection settings: Configure the IP address and Port of the Broker to which the publisher will connect.

Description of DIAScreen Interface for Broker Connection: Shows the MQTT settings for connecting to a Broker. Users input the Broker's IP/URL (e.g., 192.168.123.155) and Port (1883).

2. Set Publisher related settings: For the theme setting "TEST_TOPIC", configure the sampling method to "Numerical Variation" and the content format to "JSON Advanced".

Description of MQTT Publisher Property Settings: Displays the configuration for the MQTT Publisher. Users set the Topic to "TEST_TOPIC", the Sampling Method to "Numerical Variation", and the Content Format to "JSON (Advanced)".

Set the information to be sent in Content Settings as follows:

Description of MQTT Publisher Property Content Settings: Shows a table for defining the data payload. Columns include Name, Payload, Type, Object, Array, Value, Address, Address Type, and Length. Example entries include data for "Array1.1.1" (Type: Array, Address: $1, Type: UInt16, Length: 1), "Array2" (Type: Array, Address: $2.0, Type: Boolean, Length: 1), "Array3" (Type: Array, Address: $3, Type: UInt16, Length: 1), and "Value" (Type: String, representing a timestamp).

Create the following components:

Set the HMI IP (MQTT Publisher/Broker/Subscriber must be in the same domain).

Description of HMI IP Settings for Publisher: Shows the communication settings for the HMI, specifically setting the HMI IP address (e.g., 192.168.123.154), Subnet Mask, Default Gateway, and DNS Server IP address.

Description of HMI Screen Components: Displays a preview of the HMI screen showing input fields labeled W:$1, W:$2.0, and W:$3, each with an associated input box.

Create MQTTX project

1. Set the Broker settings (IP and Port) you want to connect to.

Description of MQTTX Connection Settings: Shows the MQTTX application interface for setting up a connection. Users configure General settings including Name (e.g., TEST_JSON), Client ID, Host (e.g., 192.168.123.155), and Port (1883).

2. Click Connect to connect to the Broker and follow the steps below to view Subscriber subscriptions.

3. After clicking Connect, click New Subscription to set the topic for subscription.

Description of MQTTX New Subscription: Shows the interface for creating a new subscription in MQTTX. Users specify the Topic (e.g., TESTTOPIC) and QoS level (e.g., 0).

Function Testing

Enter 50 for $1 (topic variable address) to trigger $2.0, and enter 100 for $3. The packet display content after parameters have been changed three times is as follows:

Description of JSON Output (Test 1): Displays the JSON data received after the first test. It includes "Array1" with a value of 1, "Array2" with a value of false, "Array3" with a value of 0, and a "Value" field showing a timestamp "2024-08-28 13:52:06".

Description of JSON Output (Test 2): Displays the JSON data received after the second test. It includes "Array1" with a value of 1, "Array2" with a value of true, "Array3" with a value of 0, and a "Value" field showing a timestamp "2024-08-28 13:53:00".

Description of JSON Output (Test 3): Displays the JSON data received after the third test. It includes "Array1" with a value of 1, "Array2" with a value of true, "Array3" with a value of 100, and a "Value" field showing a timestamp "2024-08-28 13:53:29".

5. Functions Description (MQTT Advanced Function)

Description of MQTT Publisher Property Table: Shows a table detailing various functions for configuring the MQTT Publisher. Columns include Name, Payload, Type, Object, Array, Value, Address, Address Type, and Length.

No.DescriptionFunctions
[Icon 1]Add new objectAdd a new data object. Supports multiple data formats (numerical, Boolean, string). Data is enclosed in curly brackets { }.
[Icon 2]Add new general arrayAdd a new data array. Supports multiple data formats. Data is enclosed in square brackets [ ].
[Icon 3]Add value/ Boolean arrayAdd a new numerical/Boolean array. Data is enclosed in square brackets [ ].
[Icon 4]Add valueAdd string, quantity, or Boolean values.
  • String: Can be fixed text, memory address, or timestamp (YYYY-MM-DD hh:mm:ss).
  • Quantity: Can be fixed text, memory address, or timestamp (seconds since 1970-01-01).
  • Boolean: Can be fixed True/False or a memory address.
[Icon 5]DeleteDelete the selected field.
[Icon 6]EditModify selected fields. For objects or arrays, only the name can be changed; parameters can be modified based on value.
[Icon 7]CopyCopy the selected fields.
[Icon 8]PastePaste the previously copied portion into the selected field.
[Icon 9]TemplatePaste JSON data format here; the software automatically organizes it into the correct JSON structure, saving time and customization costs.
[Icon 10]PreviewConvert the set format into actual JSON data.

6. Conclusion

This article has demonstrated the architecture of using DOP-3S10S3E2 as the Publisher, DOP-3S07S3E2 as the Broker, and a PC's MQTTX as the Subscriber. It also introduced methods for customizing advanced functions of the MQTT JSON data format.

Architecture Description: Reiteration of the network setup showing DOP-3S10S3E2 (MQTT Publisher), DOP-3S07S3E2 (MQTT Broker), and PC (MQTT Subscriber) connected via RJ45 and a switch within a Local Area Ethernet.

Project files mentioned include: Broker_3S07S3E2_Publisher_3S10S3_1.4.3.45_Json.dpa and E2_1.4.3.45_Json.c.

PDF preview unavailable. Download the PDF instead.

DELTA IA-HMI DOP300 DIAStudio MQTT JSON AM EN 20241223 Acrobat Distiller 9.0.0 (Windows)

Related Documents

Preview DOP eRemote User Manual - Remote Control Software for Delta HMIs
Comprehensive user manual for Delta's DOP eRemote software, detailing installation, configuration, connection, and remote control of HMI devices over Ethernet. Includes system requirements, supported models, and testing examples.
Preview Delta DOP-107H HMI Instruction Sheet
Instruction sheet for the Delta DOP-107H series of Human Machine Interfaces (HMIs), providing details on model explanations, general precautions, safety measures, installation, wiring, and hardware specifications.
Preview Delta DOP-3S07S3E2 / DOP-3S10S3E2 HMI Instruction Sheet and Specifications
Detailed instruction sheet and technical specifications for Delta DOP-3S07S3E2 and DOP-3S10S3E2 Human Machine Interface (HMI) panels, covering general precautions, installation, wiring, pin assignments, part descriptions, and hardware specifications.
Preview How to Bind DOP-100 to DIACloud via Wi-Fi Dongle
This document provides a step-by-step guide on how to connect a DOP-100 Human Machine Interface (HMI) to the DIACloud IoT platform using a DX-MWB-01 Wi-Fi Dongle. It covers hardware and software configuration, operational steps for binding, and the functions enabled by the connection, such as remote HMI project upload/download.
Preview DELTA DOP-W Series HMI: Installation, Operation, and Specifications
Comprehensive instruction sheet for DELTA DOP-W series HMI products (DOP-W105B, DOP-W127B, DOP-W157B), covering safety precautions, wiring, pin definitions, dimensions, and detailed specifications.
Preview DELTA DOP-100 HMI to DIACloud Binding Guide via Wi-Fi Dongle
This guide details the process of binding DELTA DOP-100 Human Machine Interface (HMI) devices to the DIACloud platform using the DX-MWB-01 Wi-Fi Dongle. It covers system overview, application scenarios, hardware configuration, and step-by-step operational instructions for seamless remote connectivity and data management.
Preview Delta DOP-B07E415 HMI Touchscreen Dimensions and Specifications
Detailed dimensional drawings and specifications for the Delta DOP-B07E415 HMI Touchscreen, part of the DOP-B Series. Includes front, side, and rear views with measurements.
Preview Delta DOP-107BV HMI Touchscreen Dimensional Drawing
Detailed dimensional drawing and specifications for the Delta DOP-107BV HMI Touchscreen, including front, side, and rear views, port identification, and dimensional tolerances.