paint-brush
Connecting Modbus RTU Smart Energy Meter and Siemens Simatic IoT2040 to NETPIEby@karthik-muthineni
4,849 reads
4,849 reads

Connecting Modbus RTU Smart Energy Meter and Siemens Simatic IoT2040 to NETPIE

by Karthik Muthineni
Karthik Muthineni HackerNoon profile picture

Karthik Muthineni

@karthik-muthineni

Researcher, working in the domain of 5G, Indoor Localization, and...

August 2nd, 2018
Read on Terminal Reader
Read this story in a terminal
Print this story
Read this story w/o Javascript
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

This article explains how to read data from Mitsubishi Modbus Energy Meter using industrial gateway Siemens Simatic IoT2040. The Simatic IoT2040 is the most preferred choice for industries to make their production data visualized in the domain of Industrial Internet-of-Things (IIoT).

People Mentioned

Mention Thumbnail

Karthik Muthineni

@karthikm618

Companies Mentioned

Mention Thumbnail
Initialized
Mention Thumbnail
Intel

Coin Mentioned

Mention Thumbnail
Flow
featured image - Connecting Modbus RTU Smart Energy Meter and Siemens Simatic IoT2040 to NETPIE
1x
Read by Dr. One voice-avatar

Listen to this story

Karthik Muthineni HackerNoon profile picture
Karthik Muthineni

Karthik Muthineni

@karthik-muthineni

Researcher, working in the domain of 5G, Indoor Localization, and Cyber-Physical Systems. #INFLUENCER

Learn More
LEARN MORE ABOUT @KARTHIK-MUTHINENI'S
EXPERTISE AND PLACE ON THE INTERNET.

This article explains how to read data from Mitsubishi Modbus Energy Meter using industrial gateway Siemens Simatic IoT2040. The Simatic IoT2040 is the most preferred choice for industries to make their production data visualized in the domain of Industrial Internet-of-Things (IIoT).

Requirements:

  1. Modbus Energy Meter (Mitsubishi SX1-A31E)
  2. Siemens Simatic IoT2040
  3. Power supply 24V DC
  4. SD-card with Yocto Linux
  5. Ethernet Cable
  6. Node-Red
  7. NETPIE account

Simatic IoT2040 Specifications:

  1. Intel Quark X1020 processor
  2. 1 GB RAM
  3. 2 X Ethernet interfaces
  4. 2 X RS232/422/485 interface
  5. Battery-buffered real-time clock

Mitsubishi Modbus Energy Meter Specifications:

  1. RS485 2 wires half-duplex
  2. RTU Mode
  3. BaudRate 1200bps
  4. Distance 1200m
  5. Response time 80ms~200ms (programmable)

Preparing Simatic IoT2040:

The first step is to boot image onto Simatic, for this SD-card of atleast 8GB is required. The Yocto Linux image can be downloaded from Siemens website. Insert SD-card into the SD-card slot of Linux computer and follow below instructions

a) On Linux, open Terminal (ctrl+alt+t) and go to the location where the zip files are downloaded.

image

b) Unzip the folder using command below

image

c) Verify the location of SD-card by running the command below

image

d) Unmount the SD-card

image

e) Burn the image file onto SD-card

image

NOTE: Replace the name of the image with downloaded image version and location of SD-card, detected by your computer.

Once the image is installed onto SD-card, place the SD-card into SD-card slot of Simatic as shown below.

image

SD-card installation on Simatic

Communicating with Simatic:

Through Secure Socket Shell (SSH), one can talk to Simatic. The Simatic comes with the default DHCP address 192.168.200.1 on Ethernet port X1P1LAN. Connect one end of ethernet cable to Linux computer with WiFi enabled and other end of ethernet cable to X1P1LAN port of Simatic and power on Simatic (require 24V DC ). When you turn on the Simatic the three LED’s will start blinking, Once the ‘SD’ led stops blinking, it means that, Simatic is now ready to communicate.

image

Simatic Initialization

Once the device has initialized follow below instructions

a) On the linux computer with wifi enabled go to Edit connections, Add Ethernet connection type, and give a name to the connection. In IPv4 settings change the method to ‘Shared to other computers’ and save.

image

image

Sharing computer WiFi with Simatic through Ethernet

b) Open Terminal and execute below command to make your computer to be on same subnet as Simatic.

image

c) Login into Simatic using SSH

image

d) On first login, type ‘yes’ to continue

e) Assign a password

After successful login, it will appear as:

image

f) Add gateway for internet connectivity

image

g) Check for internet connectivity using ping

image

h) Set the time and date of Simatic in below format (Month:Date:hour:minutes:Year)

image

Setting-up Node-Red on Simatic:

Some configurations need to be setup, to start Node-Red on Simatic

a) Go to opkg directory

image

b) Add following lines in opkg.conf

image

c) Add following lines in arch.conf

image

d) Update configurations using

image

All the configurations for Node-Red will be updated. To make Node-Red to Autostart when Simatic powers on, type iot2000setup.

A GUI will be appeared, select software-Manage Autostart options-Autostart Node-Red and press ‘Done’.

Next, go to peripherals-Configure External COM Ports-select-X30 COM-RS485 and press ‘YES’.

image

To assign baudrate for X30 COM port type following command in terminal. This step is important because by default Simatic operates on 9600 baudRate, but Mitsubishi Energy Meter operates on 1200 baudRate, so by changing Simatic BaudRate to 1200, RS485 communication between Simatic and energy meter can be established.

image

Once all the settings are changed reboot the Simatic.

image

Installing Modbus and netpie nodes on Simatic:

NOTE: Before installing nodes on Simatic, make sure your Simatic is connected to Internet by ping test.

Install Modbus Node

image

Install Netpie node

image

Connecting Modbus Energy Meter to Simatic:

NOTE: Power off the Simatic before connecting it with Energy meter.

The Modbus Energy Meter consist of two wires +ve and -ve. These two wires need to be connected to the 2 and 1 pins of X30 COM port of Simatic as described in below table.

image

Pins description of X30 COM Port configured as RS485 output

Pin diagram of X30 COM Port:

image

X30 COM Port pin diagram

Final connections:

image

image

RS485 connections between Energy Meter and Simatic

Node-Red Flow:

Open browser and type 192.168.200.1:1880, Node-Red GUI will be displayed.

a) Bring the Modbus Read node to read the data from Energy Meter and Modbus Response node to view the data.

image

Node-Red Flow

b) The configuration settings of Modbus Read node are

Unit Id — 72

FC — Read Holding Registers

Address — 0x0066 ( for Voltage )

Number of Registers — 1

Poll Rate — 1s

Method — RTU

Mode — Serial Expert

BaudRate — 1200 ( Mitsubishi default baudRate )

Databits — 8, Stopbits — 1, Parity — Even

c) Configure Microgear and Publish node to send data to NETPIE, required parameters are

APPID

KEY

SECRET

ALIAS

TOPIC

NOTE: The guide for configuring above parameters can be found here.

d) In NETPIE, add widget to visualize the data.

image

Configuring widget to display Energy Meter data

Result:

image

Visualizing Modbus Energy Meter data on NETPIE

Conclusion:

This article is the Proof-of-Concept (PoC) for using Siemens Simatic IoT2040 as a industrial gateway that handles production data in industries. Integration of Modbus Energy Meter with Simatic was discussed in this article. Similarly other industrial sensors can be integrated with Simatic that opens the path to IIoT.

Karthik Muthineni

Masters in Telecommunications/ICT

L O A D I N G
. . . comments & more!

About Author

Karthik Muthineni HackerNoon profile picture
Karthik Muthineni@karthik-muthineni
Researcher, working in the domain of 5G, Indoor Localization, and Cyber-Physical Systems. #INFLUENCER

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Balena

Mentioned in this story

coins
profiles
X REMOVE AD