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. Forums
  3. 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 8 months ago

Hi,

Hi,

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

tim_kay

5 years 8 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 8 months ago

Hi,

Hi,

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

tim_kay

5 years 8 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 8 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 8 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 8 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

  • 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