Webinar
Introducing EMQX 6.1: Durable MQTT Streams and Analytics-Ready Data | Register Now →

Build IIoT APP based on Modbus with Neuron

Weijie ChenWeijie Chen
Sep 29, 2020Product
Build IIoT APP based on Modbus with Neuron

With the development of IoT, big data, cloud computing and other new-generation information technology, IoT has widely used in various industries and application scenarios, and IoT as a whole shows the trend of device polymorphism, business diversification and application fragmentation. Especially in the IIoT scenario, the type of industrial device is various, design bus and protocols are complex and diverse, business applications are flexible, so how to smoothly implement the industrial equipment on the cloud is a problem to be solved. EMQX series products provide the ability to decouple industrial equipment and applications, construct the data path from the edge to cloud, establish an intelligent, networked and lightweight digital product and service model, and integrate with 5G to support application innovation in the industrial industry.

The era of the Industrial IoT

IIoT is the acronyms of the Industrial Internet of Things, which is the Industrial IoT consisted of hundreds of millions of pieces of the industrial device. Broadly speaking, it refers to the application of instruments, connected sensors, and other equipment to machinery and vehicles in the transportation, energy, and industrial sectors.

With the popularization of industry 4.0 concept and the deepening of industrial practice, the traditional centralized control model has transformed into a distributed enhanced control model. At the same time, the advent of the 5G era has accelerated the process of traditional industrial transformation and industrial IoT. To implement the flexible production of personalized and digital products and services, in the process of industrial devices intelligent and networked, the new and old industrial equipment needs to be connected to the internet to implement the business of data collection, remote control and configuration update of industrial equipment. EMQX series products can provide the entire solution from the industrial gateway to the platform and implement data aggregation of the industrial device and sending these data to the cloud, at the edge end of the plant and industrial site. At the same time, its processing ability for edge computing streaming data can provide cloud industrial device data access, data storage and interfacing with cloud-based configuration and applications for the industrial IoT at the platform end. Also, it can facilitate the rapid development of industrial Internet applications.

We will build a simple IIoT application based on Modbus through Neuron and EMQX, and use MQTTX to subscribe/display data.

Introduction to EMQX Neuron

EMQ has recently published an industrial protocol access software Neuron deployed on the edge gateway. As a bridge between humans and machines, it can convert and reorganize the 0/1 data of TCP/IP protocol to an easy-to-understand JSON format, and use MQTT protocol to export the data to the cloud. Therefore, it can better handle the interaction between humans and objects.

EMQX Neuron supports various kinds of industrial protocol, including Modbus, OPC, etc. It can meet most of the industrial access requirements. The detailed protocol list is as follows:

Protocol NameTypeStatus
Allen-Bradley DF1 half-duplex for PLC2SerialAvail
Allen-Bradley DF1 half-duplex for PLC5SerialAvail
Allen-Bradley DF1 for MicroLogixSerial2020
Allen-Bradley Ethernet/IP for MicroLogixEthernet2020
Allen-Bradley DF1 for ControlLogix/CompactLogix/FelxLogixSerial2020
Allen-Bradley Ethernet/IP for ControlLogix/CompactLogix/FelxLogixEthernet2020
Schneider Modbus RTUSerialAvail
Schneider Modbus TCPEthernetAvail
Schneider Telemecanique UNI-TESerialAvail
ABB SattControl ComliSerialAvail
Omron Host Link (single)SerialAvail
Omron Host Link (multiple)SerialAvail
Omron FINS on Host LinkSerial2020
Omron FINS on TCPEthernet2020
Omron FINS on UDPEthernet2020
Omron Ethernet/IP for CJ/NJEthernet2020
Siemens 3964R/RK512 for S5SerialAvail
Siemens 3964R/RK512 for S7SerialAvail
Siemens PPI for S7-200Serial2020
Siemens MPI for S7-300Serial2020
Siemens Fetch Write for S7-300/400 and CP443 moduleEthernetAvail
Siemens Industrial Ethernet ISO for S7-300/400EthernetAvail
Siemens IE Symbolic Addressing for S7-1200Ethernet2020
Siemens IE Absolute Addressing for S7-1200/1500Ethernet2020
Mitsubishi FX0N/FX0S/FX1N/FX1S/FX2SerialAvail
Mitsubishi FX2N/FX3U/FX3G/FX3SSerialAvail
Mitsubishi FX3U-ENET-L/FX3U-ENET-ADPEthernet2020
Mitsubishi FX5USerial2020
Mitsubishi FX5U Ethernet ModuleEthernet2020
Mitsubishi FX 232ADP/485BD/232BD ModuleRS4852020
Mitsubishi MC Protocol full-duplex for MELSEC-Q and C24 moduleSerial2020
Mitsubishi MC Protocol for MELSEC-Q and E71 moduleEthernetAvail
Panasonic MEWTOCOL for FPEthernet2020
GE SNP for 90-30Serial2020
GE Ethernet for 90-30Ethernet2020
FANUC 0i/30i/31i/32i/35iSerial2020
FANUC 0i/30i/31i/32i/35i EthernetEthernet2020
FANUC T21/D21 for CNC machinesEthernet2020
Modbus RTURS485Avail
Modbus RTU over TCPEthernetAvail
Modbus TCPEthernetAvail
OPC UAEthernetAvail
BACnet/MSTPRS4852020
BACnet/IPEthernet2020
IEC 60870-5 (IEC104)Ethernet2020
IEC 61850Ethernet2020
SNMPEthernet2020
DNP3Ethernet2020
DLT645-97/07Ethernet2020

The industrial architecture diagram of EMQX Neuron and EMQX Broker

List of tools used in this simulation

Tool nameVersionDescriptionOperating system
PeakHMI Slave Simulator/Modbus simulatorWindows Server 2019
EMQX Neuron1.4.6Industrial protocol gateway access softwareUbuntu 16.04
EMQX Broker4.0.7MQTT BrokerUbuntu 16.04
MQTTX1.3.2MQTT client toolmacOS 10.13.4

Simulation of industrial scenes test

Deploy/configure EMQX Neuron

  • First, unpack and install the EMQX Neuron package.
tar -xvlf neuron-1.4.2-x86_64.tar.gz 

sudo ~/bin/installneuron.sh 
  • Configure the address which connect to the EMQX Broker in the configuration file, with the username and password as authentication.
cd bin/ 

vi neuron.conf  

Modify the IP/port, username/password information of the EMQX Broker server in neuron.conf.

# MQTT server name or IP address

MQSERVER=127.0.0.1

# Server port no. Note that it will have SSL connection if setting the port no. 

# 8000 or above.

MQPORTNO=1883

# Username and password

MQUSERNAME=emqx123

MQPASSWORD=neuron123
  • Run EMQX Neuron, the startup is complete when no errors.
./neuronsrt  
  • Log in to the EMQX Neuron Web interface, access IP:7000, the default username password is admin/0000.

  • Click Edit Driver, edit the address of Modbus tcp.

  • Create Object, define the content within this Object.

Create an Attribute in this Object, and then configure the information of Attribute.

Here simulate an alarm point named Err1@@2D7WS_GAS, the point position is 1!1!07497.

Connect the deployed EMQX Broker

The connected EMQX Neuron gateway can be viewed in the EMQX Broker interface, where the Client ID is a string of characters randomly, generated by the EMQX Neuron gateway.

Configure Modbus simulator

Configure the value of the point 1!1!07497 is 1, and then report the data.

Click the Data Monitoring in the EMQX Neuron interface, the reported value of Attribute “Err1@@2D7WS_GAS” is now 1.

Use MQTTX subscribe to data for display

Open the connected MQTTX, connect to the EMQX Broker, subscribe to the above topic pubulished by EMQX Neuron, and in MQTTX you will receive the value of 1 for 2D7WS in AlarmObj. After receiving these data, the client can display alarms on the application interface, and can also implement other business transformations through the business logic.

Summary

The above is a complete simulation test of industrial access using EMQX Neuron, EMQX Broker, MQTTX and other tools to form a clearer and more intuitive understanding of industrial equipment on the cloud. Of course, you can also use the powerful protocol support of EMQX Neuron and the powerful access/forward ability of EMQX Broker to develop your own application demonstration system and build a complete IIoT platform.

By the end of September 2020, we will implement a complete edge solution for industrial protocol parsing, data aggregation and streaming processing at the edge end through integrating Neuron, Edge, Kuiper and other software. This solution can implement a complete industrial solution from end to end, and edge to cloud though integrating the cloud series product EMQX Broker / Enterprise.

Try Neuron for Free
Get Started →

Article By

Weijie Chen
Weijie Chen

EMQ Partner and Ecology Manager & Solution Manager

Subscribe to our blogs

Related Posts