ModBus TCP/IP Connection Between Remote Janitza Energy Meter and Simulink


Thread Starter


We are trying to connect an Janitza energy meter with Simulink on the pc to retrieve it's data that it is measuring. We've already been able to make a connection between the 2, but we don't get the right answer back. We don't really know how ModBus TCP/IP works.

We searched a lot on the internet and we know it exists of:
- a transaction identifier
- protocol identifier
- length field
- unit identifier
- function code
- data bytes

The only thing that the Janitza manual says is that for example the address for retrieving the frequency of the grid is 800. We tried using a constant in Simulink and were able to retrieve an answer but not the answer we needed so de encoding went wrong.

So now we are trying to figure out what we have to fill in the above parameters in order to address the frequency. I will use Velamod to check if it works before I implement it in Simulink.

I think explaining with some screenshots would be better but I can't find how to do it here. So if anybody thinks he could help I could send him these screenshots.

Thanks for reading.
Louis Casteleyn

<b>Moderator's Note:</b> At present you cannot upload screenshots to the forum. I suggest you use something like Dropbox and upload the screenshots there for people to download.
A general comment, but one common in power meters - you'll receive some binary value which must be multiplied by a constant ... and you need to get the constant from the vendor.

A simple example: you might see the number 23756, and need to divide by 100 to get the voltage as 237.56

However, it can be much more complex, as often the constant is based on the transformers used, so if you have 10A or 20A or 100A CT changes the constant. Regardless, you need to pester the vendor for the details.
I too have experienced problems like you.

The data read by the application does not match with the data that appears on the device..
Turns out the problem is, because the format of the data sent from the device it must be reversed.. people say, Big Endian and Litte Endian

Now my problem is solved..
I use 'HINET MODBUS MASTER SLAVE SERVER' to polling data from the Device in Power Plant..
After that I used 'HINET MONITORING AUTOMATION CONTROL' to display data to the monitor screen, like this ->

If your application can not reverse the data sent by the device.
This application has features of the data exchanged from Big Endian to Little Endian

Link program is here ->

Thank you..


Among various available Modbus driver components, I feel that Parijat's Drivers are more comfortable to use. From yeras, I am using Its Modbus driver for my serail & TCP devices. The Driver has all the functionality like, Zero based addressing, Double Words functionality, Reverse Byte, Floating point, ModFloating, etc. etc. And, the best thing is purely based on .Net Framework, so no third party incorporation involved.

Here is the link of different available screenshots of the Modbus Driver.

You can ask for Demo version (google it for Parijat Controlware Inc) to try it out.

-Dixit Solanki