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

5 years 1 month 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

5 years 1 month 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

5 years 1 month 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, 10/13/2026 - 12:00
    gurux.dlms.java 4.0.97
  • Tue, 09/22/2026 - 14:02
    Gurux.DLMS.Net 9.0.2609.2201
  • Mon, 09/21/2026 - 10:18
    Gurux.DLMS.Net 9.0.2609.2101
  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202

New forum topics

  • Association refresh related issue
  • Need RJ45 pin configuration for Saral 300 and Saral 305 Secure meters
  • Query Regarding Class 63 Status Mapping Support in Gurux DLMS Python
  • Inhemeter
  • DLMS Server - Profile Generic - can't add too many items to profile generic capture object - how to set maximum profile entries
More

Who's new

  • amir.jradi
  • JOEBID€N123
  • yogibear
  • Eric@li
  • Asier Sierra
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin