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 3 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 3 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 3 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 3 months ago

GXDLMSSpecialDaysTable

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

Profile picture for user Kurumi

Kurumi

9 years 3 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 3 months ago

GXDLMSSpecialDaysTable

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

  • 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