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. How To Use ClientServerExample As An Application File.

How to Use ClientServerExample as an application file.

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 pran0506 , 22 January, 2019
Forums
General discussion

Hi sir,
I have basic information about energy meter like port no,server no,client no,interface type.
I have to read data from energy meter(Apex100 secure) using rs485 medium over TCP/IP DLMS protocol.
My problem is
1.Can i used this ClientServerExample.cpp file? if Yes How can i used ?
mean how can i gave input to this file.
2.Where/How i can deploye(upload) program.
3.Any application files which is used for this?
4.if above point are not valid so how can i read data from dlms smart meter ?

i got following instruction and process but still not geeting how can i used this funcation in my project.
Simple meter reading example
http://www.gurux.fi/Gurux.DLMS.Client

I already used GXDLMSDirector software, but i want read values through programming.

Any suggestions / steps/process/documents/existing project anything which is help me too read data from dlms smart meter.

Thank you.
(sorry for poor english and words)

Profile picture for user Kurumi

Kurumi

7 years 4 months ago

How to Use ClientServerExample as an application file.

Hi,
ClientServerExample.cpp implements the example meter. If you want to read the meter you need to read it using GuruxDLMSClientExample. Change settings (client and server address) to same what you are using with GXDLMSDirector.

BR,
Mikko

pran0506

7 years 4 months ago

In reply to How to Use ClientServerExample as an application file. by Kurumi

How to Use ClientServerExample as an application file.

hi sir,
i m running clientServerExample in visual studio2017,but not getting any results
when i debugging i got argc value is eaual to 1.
so its not going inside switch loop.
//this function not going inside switch loop. because getoptr get -1 return from another lib.
while ((opt = getopt(argc, argv, "h:p:c:s:r:it:a:wP:g:S:")) != -1)
{
switch (opt)
{
case 'w':
interfaceType = DLMS_INTERFACE_TYPE_WRAPPER;
break;
case 'r':
if (strcmp("sn", optarg) == 0)
{}
//from here return -1 value because ((optind >= argc) this condition satisfied and return -1.

int getopt(int argc, _TCHAR *const argv[], const char *optstring)
{
if ((optind >= argc) || (argv[optind][0] != '-') || (argv[optind][0] == 0))
{
return -1;
}
int opt = argv[optind][1];
const char *p = strchr(optstring, opt);

if (p == 0)
{
return '?';
}
++optind;
if (p[1] == ':')
{
if (optind >= argc)
{
optarg = (char*)p;
return '?';
}
optarg = argv[optind];
++optind;
}
return opt;
}
#endif

  • 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