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 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? 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 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 Hi, Hi, You can use CGXDLMSConverter::GetUnitAsString -method for that. BR, Mikko Hi Mikko, Hi Mikko, Thanks a lot for your kind help. Thanks & Regards, Pradson
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?
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
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
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?
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
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
Hi,
Hi,
You can use CGXDLMSConverter::GetUnitAsString -method for that.
BR,
Mikko
Hi Mikko,
Hi Mikko,
Thanks a lot for your kind help.
Thanks & Regards,
Pradson