I successfully created a ProfileGeneric object (in http://www.gurux.fi/node/19730) and I can also read out the contents from the buffer and capture objects using the function below:
I can easily read the buffer contents with this read using pg.buffer.
However, read_by_range doesn't seem to work.
read_by_range DOES work with another profile that was already set in the meter, it just doesn;t work on this specific profile
The code:
begin = datetime.datetime.now() - datetime.timedelta(days=2)
end = datetime.datetime.now() - datetime.timedelta(days=1)
I think I found the error. The buffer reads like this:
row = [19059, <gurux_dlms.GXDateTime.GXDateTime object at 0x7fa98d4d2a90>]
One row looks like what is stated above.
row[0] = value
row[1] = clock
read_by_range accesses index 0 of the capture objets and thinks that is the clock while it is not.
A solution would be for the buffer to save the values of the capture objects like this:
row = [<gurux_dlms.GXDateTime.GXDateTime object at 0x7fa98d4d2a90>, 19059]
But I am not sure how to reverse that order?
Or do I need to edit the read_by_range function, however I can't find where I can choose which capture object it reads
Hi,
Hi,
Can you add GXDLMSDirector log so I can compare the date-time values?
BR,
Mikko
I think I found the error.
I think I found the error. The buffer reads like this:
row = [19059, <gurux_dlms.GXDateTime.GXDateTime object at 0x7fa98d4d2a90>]
One row looks like what is stated above.
row[0] = value
row[1] = clock
read_by_range accesses index 0 of the capture objets and thinks that is the clock while it is not.
A solution would be for the buffer to save the values of the capture objects like this:
row = [<gurux_dlms.GXDateTime.GXDateTime object at 0x7fa98d4d2a90>, 19059]
But I am not sure how to reverse that order?
Or do I need to edit the read_by_range function, however I can't find where I can choose which capture object it reads
Hi.
Hi.
All the meters that I know are adding a clock for the first column. I strongly propose that you swap clock and value.
Swap the Capture objects (value and clock) and write them back for the meter.
http://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSProfileGeneric
BR,
Mikko
Dear,
Dear,
Thank you for your response.
Yes that is the issue I am trying to solve.
EDIT: Never mind, the code I had written to switch the columns actually works, just needed to overwrite the current stats.