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. Reading The Scalar Value.

Reading the scalar value.

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 Ananthakrishnan96 , 30 July, 2020
Forums
Gurux DLMS for Android

I am new here, started working on arduino IDE with stm32l082 as client and sprint 350 meter as server.
The code is working fine and meter is responding accordingly.
I wanted to read the L1voltage and used below code

gxRegister v1;
void setup() {
bb_init(&frameData);
//Set frame size.
bb_capacity(&frameData, 128);
cl_init(&meterSettings, 1, 32, 1, DLMS_AUTHENTICATION_LOW, "ABCD0001", DLMS_INTERFACE_TYPE_HDLC);
cosem_init(BASE(v1), DLMS_OBJECT_TYPE_REGISTER, "1.0.32.7.0.255");
// start serial port at 9600 bps:
Serial.begin(9600);
while (!Serial) {
}
}

void loop() {
int ret;
//Initialize connection.
ret = com_initializeConnection();
if (ret != DLMS_ERROR_CODE_OK)
{
return;
}
ret = com_read(BASE(v1), 2);
if (ret != DLMS_ERROR_CODE_OK)
{
Serial.println("error2");
return;
}
com_close();
}

Got response from meter as follows.

1: 7E A0 20 41 03 73 3E 9D 81 80 14 05 02 02 00 06 02 02 00 07 04 00 00 00 01 08 04 00 00 00 01 6F EF 7E
<HDLC len="1F" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<!-- UA frame. -->
<FrameType Value="73" />
<PDU>
<Ua>
<MaxInfoTX Value="512" />
<MaxInfoRX Value="512" />
<WindowSizeTX Value="1" />
<WindowSizeRX Value="1" />
</Ua>
</PDU>
</HDLC>
2: 7E A0 37 41 03 30 21 79 E6 E7 00 61 29 A1 7A 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 10 1C 02 00 00 07 9C DF 7E 7E A0 15 41 03 52 10 8F E6 E7 00 C4 01 81 00 06 01 5D B7 14 9F 9E 7E
<HDLC len="4E" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<FrameType Value="52" />
<PDU>
<GetResponse>
<GetResponseNormal>
<InvokeIdAndPriority Value="81" />
<Result>
<Data>
<UInt32 Value="015DB714" />
</Data>
</Result>
</GetResponseNormal>
</GetResponse>
</PDU>
</HDLC>
3: 7E A0 20 41 03 73 3E 9D 81 80 14 05 02 02 00 06 02 02 00 07 04 00 00 00 01 08 04 00 00 00 01 6F EF 7E
<HDLC len="1F" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<!-- UA frame. -->
<FrameType Value="73" />
<PDU>
<Ua>
<MaxInfoTX Value="512" />
<MaxInfoRX Value="512" />
<WindowSizeTX Value="1" />
<WindowSizeRX Value="1" />
</Ua>
</PDU>
</HDLC>

It is clear that the result value is obtained and "seems" correct.
Inorder to be sure about the value obtained i require the scalar value too. How to obtain that too..
Thanks. Regards

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

You need to read attribute #3 to get scaler and unit before you read the value.
http://gurux.fi/Gurux.DLMS.Objects.GXDLMSRegister

BR,
Mikko

Ananthakrishnan96

5 years 10 months ago

Yah it works thank.

Yah it works thank.

  • 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