Data conversion while using MODBUS protocol

S

Thread Starter

Sai kumar

We have our own developed HMI application for power plant controls and operations.We need to communicate with other HMI system.We have configured our system as slave and other HMI system as Master.

The MODBUS protocol communication is established and data exchange of Analog and digital points were tested through standard MODBUS function codes 04 and 02.
The analog data is received in hex in Master system.
Is it required to scale the parameters in slave or in master ?
Is the data can be sent as float for analog points from slave to Master?
 
B
In reply to your questions...

Is it required to scale the parameters in slave or in master ?

Yes or no, depending upon the capabilities of your HMI software. If you can do scaling in the HMI then do it there, if not, do it in the PLC.

Is the data can be sent as float for analog points from slave to Master?

This also depends upon the capabilities of the HMI software. Most HMI software, when requesting an analog point, reads 1 register (16 bits) of data. When requesting a REAL (float) value it automatically reads 2 registers (32 bits). The HMI takes care of how many registers to read and how to "unpack" the data received.
For example, if the HMI requests 10 integers values and 4 float values it will read 28 registers of data and present it in the requested formats to the HMI displays, alarms and trending.

Modbus protocol does nothing more than what you tell it to do. It simply reads or writes data. It is up to the software using the data as to what it does with it. Bits are bits. 16 bits can be ASCII characters, integer data (signed or not), HEX data, boolean bits or part of something else (like a float or double precision integer value).
It is what you do with the data that is the key.
 
P

Prasanth Gopalakrishnan

Since you are trying to achieve inter-operability across a variety of HMI systems, it is better to ensure that your Modbus implementation is a clean implementation, without too much customized capabilities built on to it. Since MODBUS in itself does not operate on data or marshal it in any way, it would be better to leave formatting of the data to the Master, including scaling if required. This helps you to ensure that almost all other HMI's will talk to your slave, without any problem. Once the Modbus data is available at the Master, the Master HMI has anyway the capability of further processing it if required.

--------------------------------------
Prasanth Gopalakrishnan
Kalki Communication Technologies Private Limited,
2nd Floor, #147, 5th Main Road, HSR Sector 7
Bangalore 560034, Karnataka, India
Phone(O): 91-80-572 1263/4
Phone(H): 91-80-572 0353
Fax: 91-80-5721264, 1 646 365 7718
E-mail: [email protected]
Web: www.kalkitech.com
 
G

Greg Goodman

> Since you are trying to achieve inter-operability across a variety of HMI systems, it is better to ensure that your Modbus implementation is a clean implementation, without too much customized capabilities built on to it. Since MODBUS in itself does not operate on data or marshal it in any way, it would be better to leave formatting of the data to the Master, including scaling if required. ...<

I agree that you want a standards-compliant Modbus protocol implementation, but I disagree about leaving all the data processing to the masters.

If each HMI must perform additional processing steps, then your application consists of the same processing implemented several times, and probably in several different ways. If you want your device to talk with minimal hassle to a number of different HMIs, then make sure the data received at each HMI requires as little additional processing as possible. Do this by having your slave send the masters data that is as close to what you want them to have as possible.

Of course, this advice doesn't take into account your particular choices of HMI software. If you want to send floats, make sure each HMI master can parse floats from a Modbus message, and that they all do it the same way. (Most do, some do it differently, some don't do it at all.) If you want to send scaled data to all your HMIs, make sure they all support scaling of received data (presumably to divide a received integer into a float by dividing it by some fixed/known power of 10).

It's just my opinion, but I think maintaining two separate but functionally identical applications built from different HMI software packages will be hard enough without requiring them both to duplicate data processing that the slave could do instead.

Regards,

Greg Goodman Chiron Consulting
 
Top