Inst ToolsInst ToolsInst Tools
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Search
  • Books
  • Software
  • Projects
  • Process
  • Tools
  • Basics
  • Formula
  • Power Plant
  • Root Cause Analysis
  • Electrical Basics
  • Animation
  • Standards
  • 4-20 mA Course
  • Siemens PLC Course
Reading: Modbus Communication between PLC and Energy Meter
Share
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • Design
  • PLC
  • Interview
  • Control System
Search
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > Modbus Communication between PLC and Energy Meter

Modbus Communication between PLC and Energy Meter

Last updated: March 4, 2021 2:36 pm
Editorial Staff
PLC Tutorials
3 Comments
Share
5 Min Read
SHARE

Write the PLC program to read the energy meter readings in the programmable logic controller (PLC) using Modbus Communication.

Contents
Energy Meter Modbus CommunicationList of Memory bitsLadder diagram PLC Modbus communicationProgram Description

Energy Meter Modbus Communication

Modbus Communication between PLC and Energy Meter

Consider Modbus protocol supported energy meter and display the readings in the PLC. In PLC, Modbus instructions are used to read the energy meter parameters.

First, we have to Set communication parameters like address, baud rate, parity, etc. in the energy meter as per requirement or standard data.

For example, consider the energy meter that has the following parameters.

  • Address = 2,
  • Baud rate = 19200 and
  • Parity bit = 0.

We will read frequency data in the PLC from the energy meter using Modbus communication. In energy meter, different parameters are available in the Modbus and each parameter has a unique address (register) where the readings are stored.

As we are planning to get the “frequency” data into the PLC, we need its specific address and assume it as 40106. So we need to use this address in our PLC configuration, DATA_ADDR is 40106 in the MB master block.

Configure pointer address in DATA_PTR so the frequency will be received in PLC address MW500. If floating value needed, use conversion instruction to convert INT value to REAL value.

The same setting should be in PLC for Modbus RTU communication. Set all the above parameters (address, baud rate, and parity) in the MB COMM LOAD block in PLC.

MODBUS MASTER:-

Modbus master instruction is used for data communication in PLC. MB master instruction allows the program to communicate as a Modbus master using the port on a point to point module.

An instant DB will be created when a Modbus master is created in a program.

MB COMM MASTER:-

MB COMM LOAD instruction execution is necessary before using Modbus master instruction. So we used MB COMM LOAD instruction also.

MB COMM LOAD instruction configures a port for communication using the Modbus RTU protocol.

List of Memory bits

MB COMM LOAD memory bits

  • M1.2:-Always true
  • M1.0:-First scan
  • M800.0:-Done bit
  • M800.1:-Error bit
  • MW802:-Status word

MB_MASTER memory bits

  • M1.2:-Always true
  • M0.7:-Clock pulse
  • M803.0:-MB master done bit
  • M803.1:-MB master busy bit
  • M803.2:-MB master error bit
  • MW804:-MB master status word
  • MW500:-Frequency in INT
  • MD700:-Frequency in Real.

Ladder diagram PLC Modbus communication

Network 1:-

MB COMM LOAD parameters

Siemens Modbus Configuration

Network 2:-

MB MASTER Parameters

Modbus Master in Simatic PLC

Network 3:-

INT to REAL conversion instruction.

Int to Real Conversion Block in PLC

Program Description

Network 1:-

In this network, we have taken MODBUS COMM LOAD instruction for port communication. In this network, we have configured the port, baud rate and parity for communication.

Network 2:-

In this network, MODBUS_MASTER instruction used will allow the program to communicate as a Modbus master using the port on the module. Here we have configured Modbus data address parameters for the device.

Network 3:-

Conversion instruction is used for data format conversion from INT to REAL.

Done bit:- If false then transaction not completed and true then transaction completed without error

Busy bit:- If false then MB no MB master transaction in process and true then MB master transaction in process.

Error:- If false then no error in the block and true then error in block.

Status word:- Show error code for troubleshooting.

Now we get the data into the PLC registers. So we can use this data in our other function blocks or use them in graphics to display the readings for the operator.

Note:- Above application may be different from the actual application. This example is only for explanation purposes only. We can implement this logic in other PLC also. This is the simple example of meter data reading in PLC using Modbus communication, we can use this concept in other examples also. All parameters and graphical representations considered in this example are for explanation purposes only, parameters or representation may be different in actual applications. Also, all interlocks are not considered in the application.

Author: Bhavesh

If you liked this article, then please subscribe to our YouTube Channel for PLC and SCADA video tutorials.

You can also follow us on Facebook and Twitter to receive daily updates.

Read Next:

Comparison Instructions in PLC

Demultiplexer PLC ladder diagram

PLC Programming Motor Example

Industrial Communication Network

Data Handling Instructions in PLC

Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
You've successfully subscribed !

Continue Reading

Start Stop of one Motor from the same Push button PLC program
Why Are Charcoal and Salt Added to an Earthing Pit?
PLC Automatic Control of Two Outputs with one Input
How Modbus is used in Industrial Networks?
Feedback Monitoring in Safety PLC
Electrical Earthing Calculations
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
3 Comments
  • Md. Rajon mahmud says:
    April 19, 2020 at 12:47 am

    Really nice explanation. I wishing best of luck for author.

    Reply
  • amir says:
    September 5, 2022 at 5:22 pm

    Thanks. It was great.

    Reply
  • Hasan Mahboob says:
    October 3, 2022 at 1:15 am

    I think nothing better could have been than this. You are doing a job that could make duffers like me expert in this field. I must say instrumentationtools.com is no doubt a free lunch.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
210kSubscribersSubscribe
38kFollowersFollow

Categories

Explore More

#10 PLC Best Practices – Assign Register Blocks by Function
PLC to PLC Communication using S7 Connection PUT & GET Instructions
Introduction to SCADA
How to Add Security in InTouch SCADA?
Studio 5000 Tutorial: PLC Programming for Digital Alarms
3 Phase Motor Control using PLC Ladder Logic
How to Configure IP Address in Rockwell PLC?
PLC Valve Control Ladder Logic Programming

Keep Learning

PLC Conveyor Forward and Reverse Logic

Advanced PLC Conveyor Control: Forward and Reverse Rotation

InTouch SCADA Password Protection

InTouch SCADA Login Password Security

Allen Bradley PLC Example with Sub routines

How to use Sub Routines with Allen Bradley PLC

Motor Clock Wise Operation using PLC

CW and CCW Operation of Motor from Same Push button

Can a PLC Function Without an HMI or SCADA

Can a PLC Function Without an HMI or SCADA?

Siemens PLC

#20 PLC Best Practices – Identify Critical Alerts

Scaling in PLC

How to do Scaling for Analog Input in RSLogix 500?

PLC offline data of a project are compared

Compare Two Offline PLC Projects

Learn More

What is Timeout in Communication Protocols

What is Timeout in Communication Protocols?

Distribution transformer

Types of Transformers

FF instrument

H1 FF Device Configuration and Commissioning

Volume Booster Working Principle

Control Valve Volume Booster Working Principle

Digital Electronics Objective Questions

Digital Electronics Objective Questions – Set 4

Flow Measurement

Continuous Flow Measurement

Short Circuit and Open Circuit

Short Circuit and Open Circuit

Control Panels Material Take-Off (MTO)

Control Panels Material Take-Off (MTO) – Engineering Project

Menu

  • About
  • Privacy Policy
  • Copyright

Quick Links

  • Learn PLC
  • Helping Hand
  • Part Time Job

YouTube Subscribe

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?