This project has moved and is read-only. For the latest updates, please go here.

.NET Modbus master

Apr 30, 2016 at 6:48 PM
I'm really new here
I'm trying to automate the reading of an electricity meter which has a 485 port.
So far, using "Simply Modbus Master 8" I've been able to do that, but it is a commercial and graphical tool, while I'd want to use a commandline tool in order to save the data and store that into a db.
I've tried with LIBModbus, but after spending a couple of weeks compiling, I have found that the compiled dll will not expose assemblies, so my only hope are you..
I've found your work after lots of search, but there is no file in the download section and I'm really not a progeammer and I don't know how to compile from source here.. Is there a compiled DLL I can try to load ?
Many thanks!
May 1, 2016 at 6:59 AM
Well, here I provide sources because that's the most flexible way to achieve anything you want.
What's not clear to me is what you really want. I may even compile some sources for you, but...mine is a general-purpose Modbus communication library, likely a protocol open implementation than a ready-to-use package. I know there are Companies providing (typically not for free) drivers for PLCs, devices and others, but here there's no such of things.
Please, describe better your project.
May 1, 2016 at 10:21 AM
Hi Highfield, and thanks for the fast reply.
I'm trying to read an energy meter to store its values historically in a db.
The EM has a RS-485 RTU port, and so far using Libmodbus under linux I've been able to read its values.
Under windows tho, Libmodbus has many quirks, and above all, doesn't expose a manifest for .NET.
If you could provide a compiled .NET module, I'd be very grateful... I just need to invoke the connect and read methods, and store the values, that's all for me so even a standalone DLL would be 100% ok, as I just need a way from commandline to read the EM response.

Many thanks!
May 1, 2016 at 10:30 AM
I mean that, but it's not clear to me HOW the read values should be exposed by the DLL. Would you expect a text file? a console output (to parse)?
Moreover, would you need the ability to send values/coils to the device?
Just another question: how do you store the data to the db?
May 1, 2016 at 11:41 AM
Hi Highfield
well, the best option would be to return an object, but a console output is equally good.
After all, I'm going to read voltage and current from a current meter, so those are just 2 text values like "220.54954","0.15"
The meter I own outputs two 16 bit registers per value btw.

My main goal now is to read values.. While sending values is accepted (the meter accepts variations of the unit of measure it reports, as switching from W to KW, or changing the baudrate of the 485 port), that would be just an added value :)

Many, many thanks!
May 1, 2016 at 11:58 AM
Okay, let me some time to do it...