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. Questions and Issues of The Release "gurux.dlms.c 20201218.1"

Questions and issues of the release "gurux.dlms.c 20201218.1"

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 lara.wakim , 18 December, 2020
Forums
General discussion

Hello,

We downloaded the latest version and we started the testing. The register activation and script table issues are both solved.

In fact, the tariffication script table will be used in the future to change the active mask depending on the current tariff (by checking the activity calendar). So the action type of this script should be "DLMS_SCRIPT_ACTION_TYPE_WRITE" and not "DLMS_SCRIPT_ACTION_TYPE_EXECUTE" in order to write the active mask of the register activation. So after replacing the action type of the script as following:
ARR_ATTACH(SCRIPTS[0].actions, ACTIONS1, 1);
ACTIONS1[0].type = DLMS_SCRIPT_ACTION_TYPE_WRITE;
ACTIONS1[0].target = BASE(registerActivation);
ACTIONS1[0].index = 4;

We found 2 issues:

1 - We tested and tried to execute the script id 1 from the GXDLMSDirector, an exception was thrown (check the picture). So we followed the code: in the gxinvoke.c file in invoke_ScriptTable() -> if (sa->type == DLMS_SCRIPT_ACTION_TYPE_WRITE) -> cosem_setValue() -> cosem_setRegisterActivation() in the gxsetignoremalloc.c file -> else if (index == 4) -> cosem_getOctetString() -> bb_getUInt8() is throwing an exception "read access violation arr was nullptr". This is the first issue to solve.

2 - We added in the svr_prewrite() the following:
else if (e->target == BASE(registerActivation) && e->index == 4)
{
e->handled = 1;
}
so back in the gxinvoke.c file in invoke_ScriptTable() -> if (sa->type == DLMS_SCRIPT_ACTION_TYPE_WRITE) -> svr_preWrite() -> after that it was supposd not enter cosem_setValue() and svr_postWrite() because e->handled = 1 but it was entering so after checking we noticed that the condition if (!e->handled) should be if (!e1->handled) (replace e by e1 in both cases DLMS_SCRIPT_ACTION_TYPE_WRITE and DLMS_SCRIPT_ACTION_TYPE_EXECUTE). If you can please check it and be sure that this is the problem.

Best Regards,

Lara Wakim

Image

lara.wakim

5 years 5 months ago

Hi,

Hi,

The saving and loading of the object with type value array of bit-string and octet-string are solved.

Thank you!

Best Regards,

Lara Wakim

Profile picture for user Kurumi

Kurumi

5 years 5 months ago

Hi Lara,

Hi Lara,

Thank you for this info.

BR,
Mikko

lara.wakim

5 years 5 months ago

Hello Mikko,

Hello Mikko,

We downloaded the latest release and we were testing the svr_handleActivityCalendar() function.

The season and week profile are working like expected. It is checking also the dayId correctly. What is going wrong is when we are filling the argument of the svr_invoke() function. In the code it is written like this:
(ret = svr_invoke( settings,
(gxObject*)da->script,
(unsigned char)da->scriptSelector,
time,
&tm,
NULL,
&object->executedTime,
next)) != 0)

The third argument of the svr_invoke() function is commonly the index of the method of the object or here we are filling the third argument with the script selector that could be a random number in our example equal to 4.
So when the svr_invoke() function is executed
e->target = target;
e->index = index; (it will be equal to the script selector in our case 2)
so when triggering cosem_invoke(settings, e) ->if (e->index < 1 || e->index > obj_methodCount(e->target)): the function obj_methodCount(e->target) = 1 because the script table has only one method "execute" (index 1). So when checking the condition it will return "DLMS_ERROR_CODE_INVALID_PARAMETER" because e->index = 4 different to 1. So the desired script known by its selector will never be triggered.

Was the explanation of the issue clear enough? or do you need more explanation?

Best Regards,

Lara Wakim

lara.wakim

5 years 5 months ago

Hi,

THESE INFORMATION ARE LINKED TO THE POST #1

Hi,

Let me add some information concerning the issue number #1 in the post #1:
- When we try to write directly the active mask of the register activation from the GXDLMSDirector everything is going right without any exception: cosem_setRegisterActivation() -> index = 4 -> cosem_getOctetString(value->byteArr, &object->activeMask) or the value->byteArr is filled with the new active mask correctly
- Back to our issue, when we try to write the active mask by triggering the execute method of the tariffication script as "DLMS_SCRIPT_ACTION_TYPE_WRITE" it is throwing an exception because the value->byteArr is empty and is not filled with any relevant data. So you should fill it with the new active mask before triggering cosem_getOctetString().

Best Regards,

Lara Wakim

Profile picture for user Kurumi

Kurumi

5 years 5 months ago

Hi,

Hi,

Tariffication script table write issue is fixed. Get the latest version.

BR,
Mikko

Profile picture for user Kurumi

Kurumi

5 years 5 months ago

In reply to Hello Mikko, by lara.wakim

Hi,

Hi,

You are right. This is now fixed. This is tested tomorrow and a new version is released after that.

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