Invalid Index, UInt16 large or small and Access Error Problems

2 posts / 0 new
Last post
ertan2002
ertan2002's picture
Invalid Index, UInt16 large or small and Access Error Problems

Hi everyone

I am new to here and new to DLMS protocol but thank you to create a such a nice open source library. It helps me to understand better.

I am a software developer and using your .net library and have 3 errors.

Firsly, my test device is Landis+Gyr E450 and its from Switzerland.

I am debugging with the following parameters: -r LN -c 16 -s 1 -Sp COM7
(I tried to give a password but do not what is the password so I have "-P HELLO" and change Authentication as LOW but not working.

PS: I am trying to readout via an opto-header which is connected between usb port (serial com7) and the device.

Here is my entire log

Read scalers and units from the device.
0.0.99.98.11.255
0.0.1.0.0.255 Ch. 0 Clock object #1 | 0.0.96.11.11.255 Ch. 0 Event code #12 | 0.0.96.129.0.255 Manufacturer specific
-------- Reading GXDLMSData 0.0.96.129.0.255 Manufacturer specific
Index: 1 Value: 0.0.96.129.0.255
Index: 2 Value: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-------- Reading GXDLMSSapAssignment 0.0.41.0.0.255 Ch. 0 SAP Assignment
Index: 1 Value: 0.0.41.0.0.255
Index: 2 Value: [[1, LGZ1030736127594]]
-------- Reading GXDLMSData 0.0.96.11.11.255 Ch. 0 Event code #12
Index: 1 Value: 0.0.96.11.11.255
Index: 2 Value: 0
-------- Reading GXDLMSData 0.0.43.1.0.255 Ch. 0 Invocation counter #0
Index: 1 Value: 0.0.43.1.0.255
Index: 2 Value: 0
-------- Reading GXDLMSData 0.0.43.1.1.255 Ch. 0 Invocation counter #1
Index: 1 Value: 0.0.43.1.1.255
Index: 2 Value: 0
-------- Reading GXDLMSData 0.0.96.90.255.255 Ch. 0 Man. spec. abstract object
Index: 1 Value: 0.0.96.90.255.255
Index: 2 Value: 4D 31 42 44 33 36 31 33 51 44 57 35 33 6E 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-------- Reading GXDLMSData 0.0.42.0.0.255 Ch. 0 COSEM Logical device name
Index: 1 Value: 0.0.42.0.0.255
Index: 2 Value: LGZ1030736127594
-------- Reading GXDLMSAssociationLogicalName 0.0.40.0.1.255 Ch. 0 Association #1
Index: 1 Value: 0.0.40.0.1.255
Error! GXDLMSAssociationLogicalName 0.0.40.0.1.255Index: 2 Das angegebene Argument liegt außerhalb des gültigen Wertebereichs.
Parametername: Invalid attribute Index.
System.ArgumentOutOfRangeException: Das angegebene Argument liegt außerhalb des gültigen Wertebereichs.
Parametername: Invalid attribute Index.
bei Gurux.DLMS.ManufacturerSettings.GXAttributeCollection.Find(Int32 index)
bei Gurux.DLMS.Objects.GXDLMSObject.GetAttribute(Int32 index, GXAttributeCollection attributes)
bei Gurux.DLMS.Objects.GXDLMSObject.SetAccess(Int32 index, AccessMode access)
bei Gurux.DLMS.Objects.GXDLMSAssociationLogicalName.UpdateAccessRights(GXDLMSObject obj, Object[] buff)
bei Gurux.DLMS.Objects.GXDLMSAssociationLogicalName.GetObject(GXDLMSSettings settings, Object[] item)
bei Gurux.DLMS.Objects.GXDLMSAssociationLogicalName.Gurux.DLMS.Objects.IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
bei Gurux.DLMS.GXDLMSClient.UpdateValue(GXDLMSObject target, Int32 attributeIndex, Object value, List`1 columns)
bei Gurux.DLMS.GXDLMSClient.UpdateValue(GXDLMSObject target, Int32 attributeIndex, Object value)
bei Gurux.DLMS.Reader.GXDLMSReader.Read(GXDLMSObject it, Int32 attributeIndex) in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 866.
bei Gurux.DLMS.Reader.GXDLMSReader.GetReadOut() in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 644.
Index: 3 Value: 16, 1
Index: 4 Value: 2 16 756 5 8 1 LogicalName
Index: 5 Value: SelectiveAccess, Get, MultipleReferences, BlockTransferWithGetOrRead 1500 125 6 0 FF FF FF FF FF FF
Index: 6 Value: 2 16 756 5 8 2 None
Error! GXDLMSAssociationLogicalName 0.0.40.0.1.255Index: 7 Access Error : Device reports Read-Write denied.
Gurux.DLMS.GXDLMSException: Access Error : Device reports Read-Write denied.
bei Gurux.DLMS.Reader.GXDLMSReader.ReadDLMSPacket(Byte[] data, GXReplyData reply) in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 777.
bei Gurux.DLMS.Reader.GXDLMSReader.ReadDataBlock(Byte[] data, GXReplyData reply) in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 809.
bei Gurux.DLMS.Reader.GXDLMSReader.ReadDataBlock(Byte[][] data, GXReplyData reply) in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 795.
bei Gurux.DLMS.Reader.GXDLMSReader.Read(GXDLMSObject it, Int32 attributeIndex) in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 848.
bei Gurux.DLMS.Reader.GXDLMSReader.GetReadOut() in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 644.
Index: 8 Value: Associated
Index: 9 Value: 0.0.43.0.0.255
-------- Reading GXDLMSAssociationShortName 0.0.40.0.2.255 Ch. 0 Association #2
Index: 1 Value: 0.0.40.0.2.255
Index: 2 Value: [57104, 64512, 56968, 57240, 53976, 53840, 14400, 64768, 40648, 40784, 64000]
Error! GXDLMSAssociationShortName 0.0.40.0.2.255Index: 3 Der Wert für einen UInt16 war zu groß oder zu klein.
System.OverflowException: Der Wert für einen UInt16 war zu groß oder zu klein.
bei System.Convert.ToUInt16(Int16 value)
bei Gurux.DLMS.Objects.GXDLMSAssociationShortName.UpdateAccessRights(Object[] buff)
bei Gurux.DLMS.Objects.GXDLMSAssociationShortName.Gurux.DLMS.Objects.IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
bei Gurux.DLMS.GXDLMSClient.UpdateValue(GXDLMSObject target, Int32 attributeIndex, Object value, List`1 columns)
bei Gurux.DLMS.GXDLMSClient.UpdateValue(GXDLMSObject target, Int32 attributeIndex, Object value)
bei Gurux.DLMS.Reader.GXDLMSReader.Read(GXDLMSObject it, Int32 attributeIndex) in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 866.
bei Gurux.DLMS.Reader.GXDLMSReader.GetReadOut() in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 644.
Index: 4 Value: 0.0.43.0.0.255
-------- Reading GXDLMSAssociationLogicalName 0.0.40.0.0.255 Ch. 0 Current association
Index: 1 Value: 0.0.40.0.0.255
Error! GXDLMSAssociationLogicalName 0.0.40.0.0.255Index: 2 Das angegebene Argument liegt außerhalb des gültigen Wertebereichs.
Parametername: Invalid attribute Index.
System.ArgumentOutOfRangeException: Das angegebene Argument liegt außerhalb des gültigen Wertebereichs.
Parametername: Invalid attribute Index.
bei Gurux.DLMS.ManufacturerSettings.GXAttributeCollection.Find(Int32 index)
bei Gurux.DLMS.Objects.GXDLMSObject.GetAttribute(Int32 index, GXAttributeCollection attributes)
bei Gurux.DLMS.Objects.GXDLMSObject.SetAccess(Int32 index, AccessMode access)
bei Gurux.DLMS.Objects.GXDLMSAssociationLogicalName.UpdateAccessRights(GXDLMSObject obj, Object[] buff)
bei Gurux.DLMS.Objects.GXDLMSAssociationLogicalName.GetObject(GXDLMSSettings settings, Object[] item)
bei Gurux.DLMS.Objects.GXDLMSAssociationLogicalName.Gurux.DLMS.Objects.IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
bei Gurux.DLMS.GXDLMSClient.UpdateValue(GXDLMSObject target, Int32 attributeIndex, Object value, List`1 columns)
bei Gurux.DLMS.GXDLMSClient.UpdateValue(GXDLMSObject target, Int32 attributeIndex, Object value)
bei Gurux.DLMS.Reader.GXDLMSReader.Read(GXDLMSObject it, Int32 attributeIndex) in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 866.
bei Gurux.DLMS.Reader.GXDLMSReader.GetReadOut() in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 644.
Index: 3 Value: 16, 1
Index: 4 Value: 2 16 756 5 8 1 LogicalName
Index: 5 Value: SelectiveAccess, Get, MultipleReferences, BlockTransferWithGetOrRead 1500 125 6 0 FF FF FF FF FF FF
Index: 6 Value: 2 16 756 5 8 2 None
Error! GXDLMSAssociationLogicalName 0.0.40.0.0.255Index: 7 Access Error : Device reports Read-Write denied.
Gurux.DLMS.GXDLMSException: Access Error : Device reports Read-Write denied.
bei Gurux.DLMS.Reader.GXDLMSReader.ReadDLMSPacket(Byte[] data, GXReplyData reply) in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 777.
bei Gurux.DLMS.Reader.GXDLMSReader.ReadDataBlock(Byte[] data, GXReplyData reply) in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 809.
bei Gurux.DLMS.Reader.GXDLMSReader.ReadDataBlock(Byte[][] data, GXReplyData reply) in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 795.
bei Gurux.DLMS.Reader.GXDLMSReader.Read(GXDLMSObject it, Int32 attributeIndex) in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 848.
bei Gurux.DLMS.Reader.GXDLMSReader.GetReadOut() in C:\Users\erd\Development\Dlms\Tests\Gurux.DLMS.Net\Gurux.DLMS.Client.Example.Net\GXDLMSReader.cs:Zeile 644.
Index: 8 Value: Associated
Index: 9 Value: 0.0.43.0.0.255
-------- Reading GXDLMSProfileGeneric 0.0.99.98.11.255 Ch. 0 Event log #12
Entries: 1/11
Error! Failed to read first row: Access Error : Device reports scope of access violated.

Ended. Press any key to continue.

--------------------------------------------------------------------------------------

So my 3 errors:

1-
The error is something wrong with the attribute

Index: 1 Value: 0.0.40.0.1.255
Error! GXDLMSAssociationLogicalName 0.0.40.0.1.255Index: 2 Das angegebene Argument liegt außerhalb des gültigen Wertebereichs.
Parametername: Invalid attribute Index.

In GXDLMSObject.cs, GetAttrirubte method:
GXDLMSAttributeSettings att = this.Attributes.Find(index);

this code is not good because it directly throws an exception when an index cannot be found.
Values;
Index: 0xfffffffe
Attributes: https://i.imgur.com/Rgo2htC.png
As you will see, the attributes do not contain this index value. This code piece is executed 2 times, I dont know why but 2 times this error occured.

2- This error seems that it is related with Authentication. But I did not find any relation for it.

Error! GXDLMSAssociationLogicalName 0.0.40.0.1.255Index: 7 Access Error : Device reports Read-Write denied.
Gurux.DLMS.GXDLMSException: Access Error : Device reports Read-Write denied.

In the GXDLMS.cs class and in HandleGetResponse method. I have this error.

https://i.imgur.com/ePuID7E.png

As you can see in the log, LogicalName is same but Index 7 makes this problem..

3- The other error is about the type is not fit

in the GXDLMSAssociationShortName class and in the UpdateAccessRights method.

The parameter is an object array and its first item is 0xffffdf10 so its related with unsigned integer.. It can be converted with directly ToInt16

https://i.imgur.com/VPrx15e.png

I tried to solve those problems but until now I have not achived yet. I am ready to provide you extra information and I can let you to connect my computer remotely if its needed.

Finally, I tried to readout by using GXDLMSDirector application. It works somehow but I got the same error while I am reading AssociationShortName.

I right clicked the connected device and select "Read" from the menu. I have this error

https://i.imgur.com/g968jKX.png

This error is my first error (above).

And the other one, when I right click on AssociationShortName's item (0.0.40.0.2.255 Ch. 0 Association #2) and select "Read" item. I got may third error (above).

https://i.imgur.com/j8z9UOQ.png

PS: I have not see "my second" error with this app.

I hope you can help me to solve these problems. I am really trying a lot of things but until now, no solution.

Thank you
Ertan

Kurumi
Kurumi's picture
Invalid Index, UInt16 large or small and Access Error Problems

Hi,
My answers are below:

1. Invalid attribute index.
Meter returns attribute index that is outside of boundaries given in DLMS standard. Only thing what we can do it throw an exception.

2. Read-Write denied
Your meter is not allowing to read this attribute. Usually it's not implemented. This is general error and it's OK. Don't read that.

3. The other error is about the type is not fit
Short name is always UInt16.

Can you Send your trace file to me by email? That issue number 3 is bothering me. We are reading L+G E450 meters, but that is not happening.

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi