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 Could I Read Proper Format For Scalars and Units of a Profile Generic Object?

How could I read proper format for scalars and units of a profile generic object?

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 pradson , 9 October, 2019
Forums
Gurux.DLMS

Hi Mikko,

Kindly refer below mentioned code:
//--------------------------------------------------------------------------------
CGXDLMSProfileGeneric *obj = new CGXDLMSProfileGeneric("1.0.94.91.3.255");
std::string sValues;
if ((ret = comm.Read(obj, 3, sValues)) != 0){
TRACE("err! failed to read register: %s \n", CGXDLMSConverter::GetErrorMessage(ret));
}
sValues.clear();
if ((ret = comm.Read(obj, 2, sValues)) != 0){
TRACE("err! failed to read register: %s \n", CGXDLMSConverter::GetErrorMessage(ret));
}
//--------------------------------------------------------------------------------
OutPut:
{-3, 33, } | {-3, 33, } | {-3, 33, } | {-2, 35, } | {-2, 35, } | {-2, 35, } | {-3, 255, } | {-3, 255, } | {-3, 255, } | {-3, 255, } | {-2, 44, } | {0, 28, } | {0, 27, } | {0, 29, } | {-1, 30, } | {-1, 30, } | {-1, 31, } | {-1, 31, } | {0, 6, } | {0, 255, } | {0, 27, } | {0, 27, } | {0, 27, } |
//--------------------------------------------------------------------------------

But when I read the same using DLMSDirector application, then I get the below mentioned output.
//############################################################################
{0.001, Current} {0.001, Current} {0.001, Current} {0.01, Voltage} {0.01, Voltage} {0.01, Voltage} {0.001, NoUnit} {0.001, NoUnit} {0.001, NoUnit} {0.001, NoUnit} {0.01, Frequency} {1, ApparentPower} {1, ActivePower} {1, ReactivePower} {0.1, ActiveEnergy} {0.1, ActiveEnergy} {0.1, ApparentEnergy} {0.1, ApparentEnergy} {1, Minute} {1, NoUnit} {1, ActivePower} {1, ActivePower} {1, ActivePower}
//############################################################################

How could I get this type of format?
Kindly suggest me.

Thanks & Regards
Pradson

pradson

6 years 8 months ago

Hi Mikko,

Hi Mikko,

I observed scalars values like-
0 represents 1
-1 represents 0.1
-2 represents 0.01
-3 represents 0.001
etc..etc...

Am I right?

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

Scaler is pow(10, X), where X is read number. So you are right. ANSI C++ don't convert read values to the string, you must do it by your self at the moment.

BR,
Mikko

pradson

6 years 8 months ago

In reply to Hi, by Kurumi

and what about units?

and what about units?

How could I convert-
33 to "Current"
35 to "Voltage"
255 to "NoUnit"
44 to "Frequency"
...
...
etc...etc...

I mean,
Is any method which convert numeric units to string units in Gurux?

Thanks

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

You can use CGXDLMSConverter::GetUnitAsString -method for that.

BR,

Mikko

pradson

6 years 8 months ago

In reply to Hi, by Kurumi

Hi Mikko,

Hi Mikko,

Thanks a lot for your kind help.

Thanks & Regards,
Pradson

  • 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