Skip to main content

Modbus Communication between PLC and Energy Meter

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

Energy Meter Modbus Communication


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


Network 2:-

MB MASTER Parameters


Network 3:-

INT to REAL conversion instruction.

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.

Comments

Popular posts from this blog

Ferrules and Cross Ferruling

 Ferrules are identification labels provided for every wire terminations in an instrument, equipment, or electrical/instrumentation control panels. These tube-shaped sleeves can be inserted easily on each individual wire in a multi-core cable. In earlier days fixed digits/letters are used as ferrules, but now Instrumentation engineers/technicians prints out desired ferrules by using a ferrule printing machine. Typical Ferrule The numbers/ letters on the ferrules will be given as per the approved electrical hook up or loop diagrams. This helps technicians to easily identify a particular loop/wiring from a series of terminal blocks and to troubleshoot the desired terminal connection. Separate numbers on the ferrules distinguish the positive and negative polarities of wires, thus ensure the polarity protection of the instrument. Cross Ferruling  As a wire is connected on its both ends, it is quite useful to use a cross reference method for wire identification. Unlike normal ferru...

What is a Torbar? – Averaging Pitot Tubes

 The Torbar is employed for flow measurement of liquids, gases, or steam in circular, square, or rectangular section ducts for large flow rates. The Torbar is an insertion type multi-port self-averaging primary sensor for flow measurement. Torbar TORBAR is a set of Pitot tubes mounted on a bar across the pipeline with no moving parts. An averaging Pitot tube is a technology, while TORBAR is a manufacturing brand name. There are several brands available in the market with VERABAR, ANNUBAR, etc. Averaging Pitot Tube Principle Purpose Averaging Pitot tube can be employed when the average velocity of the flow profile, rather than the velocity in a specific point in the cross-section is desired. Averaging Pitot Tubes Principle It measures the differential pressure between the static pressure tap and the tap of full pressure of a stream. Thus such magnitude of differential pressure is directly proportional to the square of the flow rate. Working The TORBAR is designed in such a way that ...

Dissolved Oxygen Analyzer Working Principle

 What is dissolved oxygen ? Dissolved oxygen refers to oxygen dissolved in water. Its concentration is expressed as the amount of oxygen per unit volume and the unit is mg/L. Biologically, oxygen is an essential element for respiration of underwater life and also acts as a chemical oxidizer. The solubility of oxygen in water is affected by water temperature, salinity, barometric pressure, etc. and decreases as water temperature rises. Measurement of dissolved oxygen by the membrane electrode method The membrane electrode method measures a diffusion current or reduction current generated by the concentration of dissolved oxygen or partial pressure of oxygen to obtain the concentration of dissolved oxygen. This method is not affected by the pH value of water being measured, oxidation and reduction substances, color, turbidity, etc. and the measurement method offers good reproducibility. When a sensor is inserted into water, an air layer forms on the membrane (Teflon membrane). The ox...