Hi!
I have no problem getting the GXDLMSObject, casting it to a more specific object by objectType, and getting the stored/read values from the meter.
However, I want to get the values per attribute in the GXAttributeCollection Attributes property of the GXDLMSObject, not the exposed data stored in the other object properties such as LogicalName, Value etc.
I have tried to debug and explore the contents of an GXDLMSObject
before and after reading, before and after casting to a more specific object like GXDLMSData but the value in GXDLMSAttributeSettings in the GXAttributeCollection of the object is always empty.
What i want to do is to get the value per attribute easily bindable to a control without creating wrappers and such
For example to display,
Attribute Name | Attribute Index | Value | Access Rights
i see the object GetValue(GXDLMSSettings settings, ValueEventArgs e) from the IGXDLMSBase but i dont know where the valueeventargs comefrom or hwo to mock it to get a value for a specific attribute
Update: I was able to get…
Update:
I was able to get the values via
var val = (obj as IGXDLMSBase).GetValue(dev.Comm.client.Settings, new Gurux.DLMS.ValueEventArgs(obj, index, index, null));
im a little confused tho since some vals return byte[] some return strings
i am a little confused as to what the selector is for in the valueeventargs
Hi, The attribute value…
Hi,
The attribute value depends on the COSEM object type. GetValue returns the value that is written to the meter.
I believe that the best approach for you is to use the GetValues method and then get the value using the attribute index to get the attribute value.
BR,
Mikko
Hi thank you for the reply…
Hi thank you for the reply
ive decided to do so right now and just get the object item based on the attribute index
i didnt want to do this because ive had cases where some objects dont show the LN in the getvalues method so the object index and attribute index are off by 1 but ive tested it again and ive yet to encounter it
I'll add it here if I ever encounter it again and can be replicated
Hi, You can get the logical…
Hi,
You can get the logical name of the COSEM object from attribute index #1. You just need to decrease the attribute index by one to get the object index.
BR,
Mikko