Skip to main content
Home
for DLMS smart meters

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Simple Read From C#

Simple read from C#

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By rubenjeronimostreak, 4 February, 2021
Forums
Gurux.DLMS

Hello,

I hope that everything is fine with you all guys!

if possible, i need some help from you. I need to collect the profile load from a Landis Gyr E650 using terminal connection (line phone).
I have already successfully tested on GXDLMSDirectory and everything is OK, but i really need some help, maybe a sample code, with the steps that i need:

1) create a meter object with connection settings and connect to meter

2) make the profile read call using start and end datetime

3) dissconnect from meter

What i have now:

GXDLMSMeter meter = new GXDLMSMeter();
meter.Name = "test1";
meter.PhysicalAddress = 94067583;
meter.LogicalAddress = 1;
meter.MacDestinationAddress = 0;
meter.InactivityTimeout = 120;
meter.Conformance = 8;
meter.Manufacturer = "LGZ";
meter.InterfaceType = InterfaceType.HDLC;
meter.HDLCAddressing = Gurux.DLMS.ManufacturerSettings.HDLCAddressType.SerialNumber;
meter.MediaType = "Gurux.Terminal.GXTerminal";
meter.UseLogicalNameReferencing = false;
meter.Authentication = Authentication.None;
meter.MediaSettings = "<Number>38560</Number><Port>COM4</Port><StopBits>1</StopBits>";

Using this settings in GXDLMSDirectory the program runs fine. I've already inspect the source code of GXDLMSDirectory but it's so big and complex.

In the attached image you can see the desired item to read (load profile).

Thanks in advance,

Best regards,
Rúben Jerónimo

Image
Profile picture for user Kurumi

Kurumi

5 years 4 months ago

Hi,

Hi,

You should check client example.
https://github.com/Gurux/Gurux.DLMS.Net/tree/master/Gurux.DLMS.Client.E…

It'll implement what you want to do.

BR,
Mikko

rubenjeronimostreak

5 years 4 months ago

Hello Mikko.

Hello Mikko.
Thanks for you reply!

I've already checked the client example but i cant found the way to connect to the meter using Terminal connection type.
I dont know where setup the phone number, for example.

Can you explain what kind of object declarations are required for meter reading? i've seen GXDLMSMeter, GXDLMSClient, GXTerminal, GXDLMSDevice, etc .. and, for me it's a littly confusing.

I really feel bad because i know that your code it's well build and structured but i cannot understand all of it.

I hope that you can help me, plz.

Some testings:

GXDLMSClient client = new GXDLMSClient(false, 16, GXDLMSClient.GetServerAddress(94067583), Gurux.DLMS.Enums.Authentication.None, null, InterfaceType.HDLC);

GXTerminal cl = new GXTerminal();
cl.PhoneNumber = "38650";
cl.PortName = "COM4";
cl.BaudRate = 9600;
cl.DataBits = 8;
cl.Parity = System.IO.Ports.Parity.None;
cl.StopBits = System.IO.Ports.StopBits.One;
cl.Open();

--------

Best regards,
Rúben Jerónimo

Profile picture for user Kurumi

Kurumi

5 years 3 months ago

Hi Rúben,

Hi Rúben,

I'm sorry for the slow reply. I was received a lot of spam messages and I missed a few questions. :-(
Terminal support is not added to the example client at the moment, but you can add it quite easily.
First, add support to Gurux.Terminal using NuGet.

Then find throw new Exception("Unknown media type.") from the client example. Then set your terminal settings like this:
GXTerminal terminal = new GXTerminal();
terminal.PhoneNumber = "PHONE NUMBER";
...other serial port settings
settings.media = terminal;

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin