Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

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

Breadcrumb

  1. Home
  2. Very Basic Meter Reading Sample Code With TCP In C#

Very basic meter reading sample code with TCP in 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 tim_kay , 22 September, 2020
Forums
Gurux.DLMS

Hello. i am trying to write a code to connect and read data from a meter using tcp/ip in C#(VS2017).

I get the sample codes from official site. I downloaded the nugets.
However there are undefined variables, some terms unkown by .dll's. I could not clean the errors

Is there any simplest, shortest sample codes for doing basic job, please?

hhkx

5 years 10 months ago

Hi,

Hi,

Have a look at this page, hope this helps: http://www.gurux.fi/Gurux.DLMS.Client

tim_kay

5 years 10 months ago

Thanks but that's the page I

Thanks but that's the page I already got the codes from, in which i could not clear errors.

That's why i requested another example. maybe a shorter one only for tcp/ip communication.

hhkx

5 years 10 months ago

Hi,

Hi,

Have you installed gurux.net, gurux.dlms or any other packages that is needed from Nuget?

tim_kay

5 years 10 months ago

Hi,

Hi,
Of course i installed the packages. And at the beginning of the solution i am using:
Gurux, Gurux.DLMS, Gurux.DLMS.Objects, Gurux.Common, Gurux.Net, GXDLMS and more...

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

DLMS is not a simple protocol and you need all those files to make a connection for your meter.
It's good to know that you have installed those references from Nuget. That is common error.

What kind of errors you are getting? Please, don't post a picture.

BR,
Mikko

tim_kay

5 years 10 months ago

- Different from client which

- Different from client which is already defined, there's a "Client" which is not defined but used.
- Client, WriteTrace, Media, WaitTime does not exist in the context
- InterfaceType does not contain a definition for 'Wrapper'
- Method group is not a reference type as required by the lock statement.
- Cannot implicitly convert type 'void' to 'Gurux.DLMS.GXReplyData' --> for --> reply = ReadDLMSPacket(it, reply);
- 'GXDLMSClient' does not contain a definition for 'GetObjects' and no accessible extension method 'GetObjects' accepting a first argument of type 'GXDLMSClient' could be found (are you missing a using directive or an assembly reference?

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

I believe that there is something wrong with the references. Have you installed NuGet Package Manager?
https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-pac…

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • Version mismatch between Gurux.DLMS 9.x and Gurux.Common/Gurux.Serial 8.x
  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
More

Who's new

  • nostra
  • cuiVEAwINCoyynjjn
  • qlMlMNfbqjNumKgGFIo
  • randx-super.ru
  • Arturolooth
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin