Skip to content

Commit 01ff11b

Browse files
emqx-ci-robotRed-Asuka
authored andcommitted
sync blog
1 parent 13f6120 commit 01ff11b

File tree

5 files changed

+411
-1
lines changed

5 files changed

+411
-1
lines changed

README-ZH.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ MQTTX is a Fully Open-source MQTT 5.0 cross-platform Desktop Client, makes it ea
595595
## [Neuron - IIoT Connectivity Server](https://www.emqx.com/zh/blog/category/neuron)
596596
IoT edge industrial protocol gateway software, which supports one-stop access to dozens of industrial protocols and converts them into MQTT protocol to access the cloud industrial IoT platform. It just requires ultra-low resource consumption, and supports three major architectures of X86, ARM, and MIPS.
597597

598+
- [NeuronEX 设备反控功能实践指南](https://www.emqx.com/zh/blog/neuronex-device-control) ([Edit](https://github.com/emqx/blog/blob/main/zh/202504/neuronex-device-control.md))
598599
- [NeuronEX + DeepSeek:使用 LLM 增强复杂 IIoT 数据流计算处理能力](https://www.emqx.com/zh/blog/neuronex-and-deepseek) ([Edit](https://github.com/emqx/blog/blob/main/zh/202503/neuronex-and-deepseek.md))
599600
- [NeuronEX 3.5.0 发布:增强工业数据采集与处理能力,赋能智能制造](https://www.emqx.com/zh/blog/neuronex-v-3-5-0-release-notes) ([Edit](https://github.com/emqx/blog/blob/main/zh/202502/neuronex-v-3-5-0-release-notes.md))
600601
- [利用 KeepAlived 实现 NeuronEX 双节点高可用](https://www.emqx.com/zh/blog/achieve-high-availability-for-neuronex-using-keepalived) ([Edit](https://github.com/emqx/blog/blob/main/zh/202502/achieve-high-availability-for-neuronex-using-keepalived.md))

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ MQTTX is a Fully Open-source MQTT 5.0 cross-platform Desktop Client, makes it ea
609609
## [Neuron - IIoT Connectivity Server](https://www.emqx.com/en/blog/category/neuron)
610610
IoT edge industrial protocol gateway software, which supports one-stop access to dozens of industrial protocols and converts them into MQTT protocol to access the cloud industrial IoT platform. It just requires ultra-low resource consumption, and supports three major architectures of X86, ARM, and MIPS.
611611

612+
- [Best Practices of NeuronEX Device Control Capabilities for IIoT Automation](https://www.emqx.com/en/blog/neuronex-device-control) ([Edit](https://github.com/emqx/blog/blob/main/en/202504/neuronex-device-control.md))
612613
- [Effectively Managing OPC UA Server Tags with NeuronEX's Tag Browser Feature](https://www.emqx.com/en/blog/managing-opc-ua-server-tags-with-neuronex-tag-browser) ([Edit](https://github.com/emqx/blog/blob/main/en/202503/managing-opc-ua-server-tags-with-neuronex-tag-browser.md))
613614
- [NeuronEX + DeepSeek: Enhancing Complex IIoT Data Stream Processing with LLM](https://www.emqx.com/en/blog/neuronex-and-deepseek) ([Edit](https://github.com/emqx/blog/blob/main/en/202503/neuronex-and-deepseek.md))
614615
- [NeuronEX+Keepalived for High Availability: Master-Backup Mode Best Practice](https://www.emqx.com/en/blog/achieve-high-availability-for-neuronex-using-keepalived) ([Edit](https://github.com/emqx/blog/blob/main/en/202503/achieve-high-availability-for-neuronex-using-keepalived.md))

en/202311/promoting-cost-reduction-and-efficiency-in-oil-and-gas-production.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Based on historical cases, EMQ’s solution can help oil and gas companies save
88

99
EMQ provides a comprehensive cloud-edge collaborative architecture encompassing industrial data acquisition, edge computing, data integration, and remote operational management. This solution can be used by oil and gas companies for real-time monitoring, equipment management, HSE(Health, Safety, Environment) management, smart production, and intelligent applications. With EMQ, enterprises can achieve greater efficiency and better control over their operations.
1010

11-
![Architecture diagram](https://assets.emqx.com/images/a3788c3a294a9582e46a5f4d710218bf.png)
11+
![Architecture diagram](https://assets.emqx.com/images/4f04feeebb8a54db2d55e43cffb1df36.png)
1212

1313
### Real-time Industrial Data Acquisition
1414

en/202504/neuronex-device-control.md

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
In the Industrial Internet of Things (IIoT), bidirectional data flow is key to enabling smart manufacturing. Beyond collecting data from devices, many scenarios now require the ability to send commands back for control and automation.
2+
3+
NeuronEX is a real-time data acquisition and analytics software deployed at the industrial edge. It supports a wide range of industrial protocols for efficient data collection, filtering, and edge processing. More importantly, it offers flexible device control capabilities, allowing commands to be sent back to devices for closed-loop control in diverse industrial applications.
4+
5+
This article explores NeuronEX’s device control features and how they can help optimize production and enhance automation.
6+
7+
## What is Device Control
8+
9+
Device control refers to the process of sending commands to downstream automation devices to control device behavior or modify device parameters. NeuronEX provides multiple control methods to meet the needs of different application scenarios:
10+
11+
- **Dashboard Control**: Human control through an intuitive user interface.
12+
- **MQTT Control**: Sending control commands to devices via [MQTT protocol](https://www.emqx.com/en/blog/the-easiest-guide-to-getting-started-with-mqtt).
13+
- **Data Processing Module Control**: Implementing intelligent control using NeuronEX's data processing engine.
14+
- **API Control**: Programmatic control through RESTful API interfaces.
15+
16+
During the device control process, device tags must have writable attributes; otherwise, the write operation will fail. A writable attribute means that the tags configured in NeuronEX must have the write property, and the corresponding tags on the device side must also support write operations.
17+
18+
## Dashboard Control
19+
20+
Dashboard control is the most intuitive human-machine interaction method, suitable for operations personnel performing daily operations and temporary debugging. Access the NeuronEX Web interface, go to **Data Collection** -> **Data Monitoring** page, select the appropriate southbound device and group name, find tags with write attributes, click the Write button at the end, enter a new value in the popup dialog, and click "Submit" to complete device control.
21+
22+
![image.png](https://assets.emqx.com/images/75000a59e380aa80291e13c77aca44ee.png)
23+
24+
## MQTT Control
25+
26+
### Feature Introduction
27+
28+
MQTT control allows any client program that supports the MQTT protocol to send command data to the corresponding topic on an [MQTT Broker](https://www.emqx.com/en/blog/the-ultimate-guide-to-mqtt-broker-comparison). The NeuronEX northbound MQTT plugin subscribes to this topic to receive data and sends control commands to the southbound driver node to implement device control.
29+
30+
This method is especially effective when using EMQX to build a UNS(Unifed Name Space) in industrial scenarios.
31+
32+
![image.png](https://assets.emqx.com/images/f3129f258abc1f116c511c8f910f040c.png)
33+
34+
To use this method, you need to configure the northbound MQTT plugin in NeuronEX and set the **Write Request Topic** and **Write Response Topic**. At the same time, you need to configure the southbound driver node and set the tags to readable and writable status. The following example provides detailed instructions using EMQX and MQTTX (as an [MQTT client](https://www.emqx.com/en/blog/mqtt-client-tools)).
35+
36+
### Complete MQTT Example
37+
38+
**1) Configure Southbound D11river**
39+
40+
Configure the ModbusTCP southbound driver **modbus1** in NeuronEX, with group name **group1**, and add three data points **tag1**, **tag2**, **tag3** (supporting read and write). The modbus1 driver reads data from a Modbus simulator. For detailed information about this step, please refer to Connecting Southbound Drivers.
41+
42+
![image.png](https://assets.emqx.com/images/041de51184ac382996cea18ee5ebc363.png)
43+
44+
**2) Configure Northbound MQTT Plugin**
45+
46+
Create a new northbound MQTT plugin in NeuronEX. In the plugin configuration, you can use the default **Write Request Topic** `/neuron/HgihrB/write/req` and **Write Response Topic** `/neuron/HgihrB/write/resp` to receive MQTT control commands, as shown below. In this example, we use EMQ's public MQTT server `broker.emqx.io` as the MQTT Broker.
47+
48+
![image.png](https://assets.emqx.com/images/686f3bdf45807b66da065f27f8899ef0.png)
49+
50+
**3) EMQX Configuration**
51+
52+
There is no need to deploy or configure EMQX separately since we are using EMQ's public MQTT server.
53+
54+
**4) MQTTX Configuration**
55+
56+
Add a new connection in MQTTX to connect to the public MQTT server `broker.emqx.io`.
57+
58+
![image.png](https://assets.emqx.com/images/332a997a57a0fd72507abd2369c913cd.png)
59+
60+
Refer to the NeuronEX MQTT data control format. The JSON message structure for controlling a single data tag is as follows:
61+
62+
- **uuid** is a unique identifier generated by NeuronEX, used to match response data when receiving control responses.
63+
- **node** is the southbound driver node name; in this example, it's `modbus1`.
64+
- **group** is the southbound driver group name; in this example, it's `group1`.
65+
- **tag** is the southbound driver tag name; in this example, it's `tag1`.
66+
- **value** is the value to be written; in this example, it's `1234`.
67+
68+
```json
69+
{
70+
"uuid": "cd32be1b-c8b1-3257-94af-77f847b1ed3e",
71+
"node": "modbus1",
72+
"group": "group1",
73+
"tag": "tag1",
74+
"value": 1234
75+
}
76+
```
77+
78+
For more information about the NeuronEX MQTT data control format, such as multi-tag writing, please refer to [MQTT Upstream and Downstream Data Format](https://docs.emqx.com/en/neuronex/latest/configuration/north-apps/mqtt/api.html#write-tag).
79+
80+
In MQTTX, enter the JSON message above and configure the send topic as `/neuron/HgihrB/write/req`. Click the “send” button to send the control command to the MQTT Broker.
81+
82+
To check if the control was executed successfully, you can use MQTTX's “**+ New Subscription**” button to subscribe to the `/neuron/HgihrB/write/resp` topic and view the response data.
83+
84+
![image.png](https://assets.emqx.com/images/a38bc23a0db2a4c24288463ff386ba5a.png)
85+
86+
**5) View Control Results**
87+
88+
On the **Data Collection** -> **Data Monitoring** page in NeuronEX, you can see that the value of tag1 has been updated to 1234, indicating that the control of tag1 in the southbound driver modbus1 through the MQTT client MQTTX was successful.
89+
90+
![image.png](https://assets.emqx.com/images/5f308dc588aa27fc3eeee825bfb9100e.png)
91+
92+
There’s no need to configure the southbound driver to the MQTT driver's subscription list if you only want to control devices using the MQTT driver. However, if you also want to report data from the southbound driver to the MQTT Broker via the MQTT driver, you must add the southbound driver to the MQTT driver’s subscription list.
93+
94+
## Data Processing Module Control
95+
96+
### Feature Introduction
97+
98+
NeuronEX's data processing module provides powerful data analysis and processing capabilities that can automatically trigger device control based on business logic, implementing automated control and closed-loop feedback.
99+
100+
In this example, we will use the value of tag1 collected by the NeuronEX southbound driver node modbus1 to automatically control and write to tag2 of the southbound driver node modbus1.
101+
102+
### Usage Example
103+
104+
**1) Send modbus1 Driver Data to the Data Processing Module**
105+
106+
Continue using the modbus1 driver from the [Complete MQTT Example](https://emqx.atlassian.net/wiki/spaces/EMQXBC/pages/1617821733/NeuronEX+Device+Control+Best+Practices#complete-mqtt-example). As shown in the figure below, configure the driver collection group to the data processing module's subscription group. After configuration, the neuronStream in the data processing module will receive all collection data from the modbus1 driver every second.
107+
108+
![image.png](https://assets.emqx.com/images/d8561b59d3f292588b4d217ff7f963b9.png)
109+
110+
**2) Create a Rule and Test Data Inflow**
111+
112+
To create a rule, navigate to the **Data Processing -> Rules page** and click on "Create Rule." Then, click the "Run Test" button to confirm that the data processing module is receiving collection data from the Modbus1 driver every second. This indicates that the previous configuration steps were successful. Once you have verified this, you can stop the rule test.
113+
114+
![image.png](https://assets.emqx.com/images/62b1aa25905bb72556f44c2b53796a41.png)
115+
116+
**3) Configure Control**
117+
118+
Edit the SQL editor on the current page and enter the following SQL statement. This SQL statement renames the value of tag1 to tag2, and the SQL data result is `{tag2: 1234}`. You can also enable rule debugging here to test and view the rule SQL output.
119+
120+
```sql
121+
SELECT
122+
values.tag1 as tag2
123+
FROM
124+
neuronStream
125+
```
126+
127+
Select the rule action as `Neuron` type and configure as follows, indicating that the SQL output data result will be written to **tag2** of the southbound driver **modbus1** collection group **group1**.
128+
129+
![image.png](https://assets.emqx.com/images/5163d0920b13e0a76fdc400d407b25c0.png)
130+
131+
![image.png](https://assets.emqx.com/images/c23e3457d8c117ad2e3b647b235ba064.png)
132+
133+
After saving the rule, it automatically enters the running state.
134+
135+
**4) View Control Results**
136+
137+
Navigate to the **Data Collection** -> **Data Monitoring** page to verify that the value of **tag2** has been updated to `1234`. This indicates that the control of **tag2** in the southbound driver **modbus1** through the data processing module was successful.
138+
139+
At this point, we can click the Write button for **tag1** to write a new value of `5678`, and we can see that the value of **tag2** is also updated to `5678`, indicating that the control of **tag2** in the southbound driver **modbus1** through the data processing module was successful.
140+
141+
![image.png](https://assets.emqx.com/images/56690ef54a1db3f055a748ed5ead5821.png)
142+
143+
Using data processing module control enables the implementation of more complex control logic. This includes triggering various control operations based on different conditions, or initiating control actions based on combinations of multiple conditions, thereby facilitating the rapid development of intelligent applications in industrial settings.
144+
145+
## API Control
146+
147+
### Feature Introduction
148+
149+
NeuronEX provides comprehensive RESTful API interfaces that allow third-party applications to implement device control through the HTTP protocol. This method offers high flexibility and is suitable for integration with other systems.
150+
151+
By calling NeuronEX's RESTful API, you can read and write device tags data. For more details, please refer to the [NeuronEX API Documentation](https://docs.emqx.com/en/neuronex/latest/api/api-docs.html).
152+
153+
### POSTMAN Control Example
154+
155+
POSTMAN is a commonly used API testing tool that can implement device control by calling NeuronEX's RESTful API.
156+
157+
**1) Obtain NeuronEX Token**
158+
159+
In POSTMAN, select the POST method and call the `localhost:8085/api/login` interface. Set the request body to JSON format, enter the username and password, and click the send button to obtain the NeuronEX Token.
160+
161+
![image.png](https://assets.emqx.com/images/dbf2f66cbb508bf5f65bce195a345ab0.png)
162+
163+
**2) Call the Control Interface to Write Data**
164+
165+
In POSTMAN, select the POST method and call the interface at `localhost:8085/api/neuron/write`. Set the request header for `Authorization` with the value `Bearer ${Token}`. Then, set the request body to JSON format and input the control JSON message. Finally, click the send button to execute device control. For detailed information about the `/api/neuron/write` interface, please refer to the [NeuronEX API Documentation](https://docs.emqx.com/en/neuronex/latest/api/api-docs.html#tag/rw/paths/~1api~1neuron~1write/post).
166+
167+
```json
168+
{
169+
"node": "modbus1",
170+
"group": "group1",
171+
"tag": "tag1",
172+
"value": 12
173+
}
174+
```
175+
176+
![image.png](https://assets.emqx.com/images/7abec667d00ffb08f3984a45d6ba3cf9.png)
177+
178+
**3) View Control Results**
179+
180+
On the **Data Collection** -> **Data Monitoring** page in NeuronEX, you can see that the value of **tag2** has been updated to `12`, indicating that the control of **tag2** in the southbound driver **modbus1** through the API was successful.
181+
182+
![image.png](https://assets.emqx.com/images/059398c041facfaa8a36982d77c0fa0c.png)
183+
184+
## Summary
185+
186+
The multiple device control functions provided by NeuronEX offer powerful support for intelligent control of industrial devices. Whether it's manual operation, remote control, or automated control, all can be implemented through NeuronEX. The flexible combination of these functions can greatly enhance the intelligence level and operational efficiency of industrial production.
187+
188+
Users can choose the most suitable control solution based on their actual needs and implement comprehensive device management and control from edge to cloud through NeuronEX.
189+
190+
Download NeuronEX now and start your industrial digital transformation journey: [https://www.emqx.com/en/try?tab=self-managed](https://www.emqx.com/en/try?tab=self-managed)
191+
192+
For the full features of NeuronEX, please refer to the documentation: [Product Overview | NeuronEX Documentation](https://docs.emqx.com/en/neuronex/latest/)
193+
194+
195+
196+
<section class="promotion">
197+
<div>
198+
Talk to an Expert
199+
</div>
200+
<a href="https://www.emqx.com/en/contact?product=solutions" class="button is-gradient">Contact Us →</a>
201+
</section>

0 commit comments

Comments
 (0)