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. SetArray Throws Exception While Trying To Parse a Structure Object

SetArray throws exception while trying to parse a structure object

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 orim , 22 February, 2017
Forums
Gurux.DLMS

Hi!

Is this method, SetArray, working as it should or am I doing something wrong?

https://github.com/Gurux/Gurux.DLMS.Net/blob/0e05275a0a81e468a9dcb92d87…

I can't get it to work it is called during the following packet:

GxDlmsClient.Method(<a GXDLMSSpecialDaysTable object>, 1, <a GXDLMSSpecialDay object>, DataType.Structure)

The error I'm getting is:

System.InvalidCastException : Unable to cast object of type 'Gurux.DLMS.Objects.GXDLMSSpecialDay' to type 'System.Object[]'.

Profile picture for user Kurumi

Kurumi

9 years 7 months ago

GXDLMSSpecialDaysTable

Hi,

Do you want to insert or delete special day ? Or just get a list of them?

BR,

Mikko

orim

9 years 7 months ago

Insert/replace

I want to insert/replace the existing ones as mentioned in the Blue Book:

"If a special day with the same index or with the same date as an already defined day is inserted, the old entry will be overwritten"

I have tried getting a list of them and deleting them using method nr. 2, worked fine!

Profile picture for user Kurumi

Kurumi

9 years 7 months ago

GXDLMSSpecialDaysTable

Hi,

We do not have method in GXDLMSSpecialDaysTable at the moment, but I'll add that to the work list. It should be ready today.

BR,

Mikko

orim

9 years 7 months ago

GXDLMSSpecialDaysTable

OK, awesome. Thanks for the quick reply. :)

Profile picture for user Kurumi

Kurumi

9 years 7 months ago

GXDLMSSpecialDaysTable

Hi,

We have added new methods Insert and Delete for GXDLMSSpecialDaysTable for C#. Support for Java, ANSI C++ and ANSI C are coming later. Get new version from GitHub or nuget.org.

GXDLMSSpecialDay e = new GXDLMSSpecialDay();
e.DayId = 2;
e.Date = DateTime.Now;
e.Index = 1;
GXDLMSClient cl = new GXDLMSClient(true, 16, 1, Authentication.None, null, InterfaceType.WRAPPER);
GXDLMSSpecialDaysTable d = new GXDLMSSpecialDaysTable();
d.Insert(cl, e)

BR,

Mikko

orim

9 years 6 months ago

GXDLMSSpecialDaysTable

Just tried it out, works like a charm! Thanks!

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More

Who's new

  • cyby
  • Metin Onan
  • ssv007
  • 3nzol3dur
  • dw772
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin