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. Adding New Objects To Sample Arduino Code

Adding new objects to sample Arduino code

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 bhatiasidharth.89 , 20 September, 2021
Forums
General discussion

Hi Mikko,

Can you please explain with an example about how I can add new objects to the sample Arduino code? The default code has a very limited number of objects. I would like to understand how I can add more of these according to my needs.

Thanks and Regards
Sidharth

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi Sidharth,

Hi Sidharth,

You need to create a new instance from the object. Then initialize it and add it to the association view. Then you need handle it on _read, _write or _action or if you can read value from the memory, you don't need handle read. Just initialize memory address where value can read.

static gxRegister reActivePowerL1;
static gxObject* ALL_OBJECTS[] = {..., BASE(reActivePowerL1)};
const unsigned char ln[6] = { 1, 1, 23, 25, 0, 255 };
if ((ret = INIT_OBJECT(reActivePowerL1, DLMS_OBJECT_TYPE_REGISTER, ln)) == 0)
{
reActivePowerL1.Value = 10;
GX_UINT16_BYREF(reActivePowerL1.value, activePowerL1Value);
//10 ^ 3 = 1000
reActivePowerL1.scaler = 3;
reActivePowerL1.unit = 30;
}

http://www.gurux.fi/Gurux.DLMS.Server

BR,
Mikko

bhatiasidharth.89

4 years 8 months ago

Thanks Mikko,

Thanks Mikko,

I was able to use this information to add a register object and a script table object to the code.

Regards
Sidharth

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi Sidharth,

Hi Sidharth,
You should check the GuruxDLMSServerExample2. There are a lot of examples of how to add different COSEM objects to the server.

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