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. Object PRIME PLC MAC Functional Parameters Giving Hardware Error When Reading

Object PRIME PLC MAC functional parameters giving hardware error when reading

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 , 7 October, 2020
Forums
General discussion

lara.wakim

5 years 9 months ago

Hi,

Hi,

We create the primeNbOfdmPlcMacFunctionalParameters object and initialize the object in the addPrimeNbOfdmPlcMacFunctionalParameters() function.

Knowing that the sna attribute is a gxbytebuffer it is defined like this:

//Define MAC SNA.
static unsigned char MAC_SNA[6] = { 0x10, 0x31, 0x46, 0x03, 0x39, 0x01 };
BB_ATTACH(primeNbOfdmPlcMacFunctionalParameters.sna, MAC_SNA, 6);

When trying to read this object, it gave a hardware fault (check the picture).

Do you have any idea about what happening? Is it a problem for the client or/and server side?

Best Regards,

Lara Wakim

lara.wakim

5 years 9 months ago

Hi,

Hi,

We create the primeNbOfdmPlcMacFunctionalParameters object and initialize the object in the addPrimeNbOfdmPlcMacFunctionalParameters() function.

Knowing that the sna attribute is a gxbytebuffer, it is defined like this:

//Define MAC SNA.
static unsigned char MAC_SNA[6] = { 0x10, 0x31, 0x46, 0x03, 0x39, 0x01 };
BB_ATTACH(primeNbOfdmPlcMacFunctionalParameters.sna, MAC_SNA, 6);

When trying to read this object, it gave a hardware fault (check the picture).

Do you have any idea about what happening? Is it a problem for the client or/and server side?

Best Regards,

Lara Wakim

Image

lara.wakim

5 years 9 months ago

Excuse me for the repetition

Excuse me for the repetition of the message, we had a technical problem.

Profile picture for user Kurumi

Kurumi

5 years 9 months ago

Hi Lara,

Hi Lara,

I'll checked this. There is an error in gxget.c. Find cosem_getPrimeNbOfdmPlcMacFunctionalParameters and change this line:
ret = cosem_getOctectString2(e->value.byteArr, object->sna.data, (uint16_t)object->sna.size, &size);

to:

ret = cosem_setOctectString2(e->value.byteArr, object->sna.data, (uint16_t)object->sna.size, &size);

I'm sorry, but tests are in progress and we can't release a new version yet.

BR,
Mikko

lara.wakim

5 years 9 months ago

Hi Mikko,

Hi Mikko,

We replaced the function and it worked. We were able to read the object.

We faced some problem also with the object primeNbOfdmPlcMacNetworkAdministrationData.

In fact, the switchTable is a gxArray of uint16 (/*Switch table.*/gxArray switchTable;//uint16_t[]).
We tried to fill it like this:

static uint16_t SWITCH_TABLE[3] = { 0 };
ARR_ATTACH(primeNbOfdmPlcMacNetworkAdministrationData.switchTable, SWITCH_TABLE, 2);
SWITCH_TABLE[0] = 0x7FFF;
SWITCH_TABLE[1] = -32767;

When trying to read this object, it gave specified cast not valid (check the picture).

Can you check the reason of this issue and tell us how to solve it?

Best Regards,

Lara Wakim

Image
Profile picture for user Kurumi

Kurumi

5 years 9 months ago

Hi Lara, Mikko

Hi Lara,

Can you open gxget.c and find cosem_getSwitchTable method? Then change this:
cosem_setUInt16(data, *it)
to:
cosem_setInt16(data, *it)

This is fixed to the next release.

BR,

Mikko

lara.wakim

5 years 9 months ago

Hi Mikko,

Hi Mikko,

Thank you the problem is solved concerning the switch table.

There is still one issue concerning the object primeNbOfdmPlcMacNetworkAdministrationData more specifically the physical communication.

In fact, we tried to fill some attribute of the gxMacPhyCommunication structure like this:

static gxMacPhyCommunication PHY_COMMUNICATION[2] = { 0 };
static unsigned char EUI[6] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 };
ARR_ATTACH(primeNbOfdmPlcMacNetworkAdministrationData.communications, PHY_COMMUNICATION, 1);
PHY_COMMUNICATION[0].txPower = 127;
PHY_COMMUNICATION[0].txCoding = -128;
memcpy(PHY_COMMUNICATION[0].eui, EUI, 6);

When trying to read the object, the showed value in the client side are incorrect and don't correspond to the chosen one (check the picture).

Can you check the reason of this issue and tell us how to solve it?

We always want to add that we need the reset method for primeNbOfdmPlcMacNetworkAdministrationData object. We noticed that the reset method is implemented on the server side. However, it is not implemented on the client side (there is no reset button to click).

Best Regards,

Lara Wakim

Image
Profile picture for user Kurumi

Kurumi

5 years 9 months ago

Hi Lara,

Hi Lara,

A new version is finally released. Get it and this should be also fixed.ยจ

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
  • DLMS server - serving multiple similar datasets gathered from multiple meters across distinct logical addresses
More

Who's new

  • CTKNhZElptjSlOrpkXl
  • YCbccqfLGRMnlCWoJhXP
  • Malcolmactig
  • mhliang
  • Kevinmug
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin