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. 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 5 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 5 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 5 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 5 months ago

GXDLMSSpecialDaysTable

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

Profile picture for user Kurumi

Kurumi

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

GXDLMSSpecialDaysTable

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

  • 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

  • T_APPL_DATA_LN_N1 subtest 3 fails on an LN-only server regardless of the response to a non-existing-object GET
  • Version mismatch between Gurux.DLMS 9.x and Gurux.Common/Gurux.Serial 8.x
  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
More

Who's new

  • OlegVoiva
  • Martaepili
  • Vegazone-Alini
  • Curtistig
  • hollycx60
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin