Hi,
I'm using Gurux.DLMS Python.
Now I'm able to read the whole register it works fine but it takes a long time. Invoking self.getAssociationView() takes long time. Is it possible to get just selected values maybe by OBIS code or sth like that?
Or if it's not possible how to save getAssociationView obj to the file?
To this time I have try sth like this
test = GXDLMSClock("1.1.32.7.0.255")
self.read(test, 3)
self.read(test, 2)
print(test)
but it throws an error
File ".../Gurux.DLMS.Client.Example.python/main.py", line 105, in main
reader.readAll(settings.outputFile)
File "...\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 590, in readAll
self.read(test, 3)
File "...\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 322, in read
data = self.client.read(item, attributeIndex)[0]
File ...\GXDLMSClient.py", line 974, in read
return self._read(item.name, item.objectType, attributeOrdinal)
File "...\GXDLMSClient.py", line 963, in _read
sn += (attributeOrdinal - 1) * 8
TypeError: can only concatenate str (not "int") to str
You try to read your meter using Short Name referencing. When Short Name referencing is used you must also give the short name address and it's different for each meter type. For this reason, it might be good to read the association view and save it for each different meter type.
You need to create object like this:
test = GXDLMSClock("1.1.32.7.0.255", SHORT_NAME)
You can save the association view to the file with -o parameter. Like this:
-o output.xml
I pasted those lines to GXDLMSReader.py in ReadAll() function and in output.xml it saves just
<?xml version="1.0" ?>
<Objects/>
in first approach -o output.xml it saves associationView fine.
so when I use this output.xml like this
items = GXDLMSObjectCollection()
c = GXDLMSObjectCollection.load("output.xml")
items.extend(c)
I'm able to read whole register.
I pasted those lines to GXDLMSReader.py in ReadAll() function and in output.xml it saves just
<?xml version="1.0" ?>
<Objects/>
in first approach -o output.xml it saves associationView fine.
so when I use this output.xml like this
items = GXDLMSObjectCollection()
c = GXDLMSObjectCollection.load("output.xml")
items.extend(c)
I'm able to read whole register.
Hi,
Hi,
You try to read your meter using Short Name referencing. When Short Name referencing is used you must also give the short name address and it's different for each meter type. For this reason, it might be good to read the association view and save it for each different meter type.
You need to create object like this:
test = GXDLMSClock("1.1.32.7.0.255", SHORT_NAME)
You can save the association view to the file with -o parameter. Like this:
-o output.xml
BR,
Mikko
Thank you very much for your
Thank you very much for your response, now reading selected values works fine.
How to use output.xml? sth like open("output.xml", 'r')?
Hi,
Hi,
You can save values like this;
items = GXDLMSObjectCollection()
items.save("fileName.xml")
Load like this:
c = GXDLMSObjectCollection.load("fileName.xml")
items.extend(c)
BR,
Mikko
I pasted those lines to
I pasted those lines to GXDLMSReader.py in ReadAll() function and in output.xml it saves just
<?xml version="1.0" ?>
<Objects/>
in first approach -o output.xml it saves associationView fine.
so when I use this output.xml like this
items = GXDLMSObjectCollection()
c = GXDLMSObjectCollection.load("output.xml")
items.extend(c)
I'm able to read whole register.
I pasted those lines to
I pasted those lines to GXDLMSReader.py in ReadAll() function and in output.xml it saves just
<?xml version="1.0" ?>
<Objects/>
in first approach -o output.xml it saves associationView fine.
so when I use this output.xml like this
items = GXDLMSObjectCollection()
c = GXDLMSObjectCollection.load("output.xml")
items.extend(c)
I'm able to read whole register.