I am a beginner of DLMS communication, so I start with the .NET example on Github.
I can successfully communicate with my SL7000 device trought a .NET application:
- I can read registers & extended registers
- I can read & write clock value
Next step I need to get a range of data from the device. I read many forum post and I see that the SL7000 and ACE6000 have some problems with these queries.
It not clearly understand what columns means in this case, but I start download the data range from device with this code:
Dim EC As New GXDLMSClock
EC.LogicalName = "0.0.1.0.0.255"
EC.Description = "Clock"
Dim CO As New GXDLMSCaptureObject
CO.AttributeIndex = 2
CO.DataIndex = 0
Dim PR As New GXDLMSProfileGeneric()
PR.AccessSelector = Objects.Enums.AccessRange.All
PR.LogicalName = "1.0.99.10.2.255"
PR.CapturePeriod = 15 ' what is the unit? second?
PR.ProfileEntries = 100
PR.SortMethod = Objects.Enums.SortMethod.FiFo
PR.SortObject = EC ' how can I sort by date?
PR.CaptureObjects.Add(New GXKeyValuePair(Of GXDLMSObject, GXDLMSCaptureObject)(EC, CO))
Dim result = comm.ReadRowsByEntry(PR, 1, 1)
The comm variable represents the GXCommunication class from the Github example.
Can you help me please to get forward with the above code?
I try query the data with GXDLMSDirector and its working (please see attached image).
I would like to get the same table in .NET environment.
Unfurtunatelly the Read method of the GXCommunication class have only 2 parameters. (GXDLMSObject and attributeIndex).
I try the Read method with the GXDLMSSecureClient class, but the excepted parameter list in this case:
Name, ObjectType, AttributeOrdinal. In transform your code to:
Dim result = dlms.Read("1.0.99.10.2.255", 1, 1)
The result is a byte array with Byte()() type. Can you help me please to convert back this result to readable format? I use the Read method with correct parameters?
No problem, thanks for the fix. Now I can receive the result, but can you help me please identify the byte array result? The status and datetime are clear, but what can I see in the other array indexes? (I mark with blue lines in the attached image).
If I good understand, I can get only "ALL DATA" from SL7000 (profile generic), I cannot receive data between dates? The Gurux DLMS Director shows an error if I query between dates: "Access Error: Device reports scope of Access violated".
SL7000 is using profile generics inside of profile generics. For this reason you can see Array of objects.
Structure is describe on LogicalDevice SL761 document. You should ask that from the vendor.
All profile generics are not support read by range. You can example read Billing period 2 (0.1.98.2.0.255) using dates, but there are other tables that are not support it.
Thank you, I'm close to the solution. With this code I can read profile generic data. My problem is, that I cannot filter the data for example by datetime range. I get back always all data from the meter and in some cases it is very slow. Can you help me please extend this code to download only the previous day data?
My second question is: can I get back the datetime from the meter that related to the profile generic data stamps?
Dim PR As New GXDLMSProfileGeneric()
PR.LogicalName = "0.0.99.1.0.255"
' This part has no effect:
' ----------------------------------------
PR.AccessSelector = Enums.AccessRange.Range
PR.From = DateTimeOffset.Now.AddDays(-1)
PR.To = DateTimeOffset.Now
' ----------------------------------------
Dim captureObjects = client.Read(PR, 3) ' OK!
' Scenario 1: Read all data -> WORKING!
Dim result1 = client.Read(PR, 2)
' Scenario 2: Read data by range -> NOT WORKING! I get back a zero-length array all time.
Dim result2 = client.ReadRowsByRange(PR, Now.AddDays(-1), Now)
DateTime is in byte arrays there. SL7000 is behaving badly and returning complex arrays back.
You can use GXDLMSClient.ChangeType to convert byte array to DateTime.
BR,
Thank you, this conversion is working, but: If I query 1 day of data (with 15 min density), I get an array with 96 elements back. The datetime is stored in the 0. index of every array element, but only the first array element contains the datetime value. In the other 95 cases the datetime value is nothing (null).
Do you have any idea why only the first element contains the datetime?
Read profile generic data from SL7000
Hi,
You can get all data like this:
Dim PR As New GXDLMSProfileGeneric()
PR.LogicalName = "1.0.99.10.2.255
Dim result = comm.Read(PR, 2)
We are making changes for ReadByEntry and ReadByRange for SL7000.
I have done VB for a while, so there might be errors on this example. :-)
BR,
Mikko
Hi, thanks for help.
Hi, thanks for help.
Unfurtunatelly the Read method of the GXCommunication class have only 2 parameters. (GXDLMSObject and attributeIndex).
I try the Read method with the GXDLMSSecureClient class, but the excepted parameter list in this case:
Name, ObjectType, AttributeOrdinal. In transform your code to:
Dim result = dlms.Read("1.0.99.10.2.255", 1, 1)
The result is a byte array with Byte()() type. Can you help me please to convert back this result to readable format? I use the Read method with correct parameters?
Thank you!
Read profile generic data from SL7000
Hi,
Sorry. I fixed the example. Now it should work. It reads buffer from profile generic.
BR,
Mikko
No problem, thanks for the
No problem, thanks for the fix. Now I can receive the result, but can you help me please identify the byte array result? The status and datetime are clear, but what can I see in the other array indexes? (I mark with blue lines in the attached image).
If I good understand, I can get only "ALL DATA" from SL7000 (profile generic), I cannot receive data between dates? The Gurux DLMS Director shows an error if I query between dates: "Access Error: Device reports scope of Access violated".
Thanks!
Image: http://download.konsys-international.com/Shared/sl7000b.png
Read profile generic data from SL7000
Hi,
SL7000 is using profile generics inside of profile generics. For this reason you can see Array of objects.
Structure is describe on LogicalDevice SL761 document. You should ask that from the vendor.
All profile generics are not support read by range. You can example read Billing period 2 (0.1.98.2.0.255) using dates, but there are other tables that are not support it.
BR,
Mikko
Filter data
Hi Mikko,
Thank you, I'm close to the solution. With this code I can read profile generic data. My problem is, that I cannot filter the data for example by datetime range. I get back always all data from the meter and in some cases it is very slow. Can you help me please extend this code to download only the previous day data?
My second question is: can I get back the datetime from the meter that related to the profile generic data stamps?
Dim PR As New GXDLMSProfileGeneric()
PR.LogicalName = "0.0.99.1.0.255"
' This part has no effect:
' ----------------------------------------
PR.AccessSelector = Enums.AccessRange.Range
PR.From = DateTimeOffset.Now.AddDays(-1)
PR.To = DateTimeOffset.Now
' ----------------------------------------
Dim captureObjects = client.Read(PR, 3) ' OK!
' Scenario 1: Read all data -> WORKING!
Dim result1 = client.Read(PR, 2)
' Scenario 2: Read data by range -> NOT WORKING! I get back a zero-length array all time.
Dim result2 = client.ReadRowsByRange(PR, Now.AddDays(-1), Now)
Thank you!
Read profile generic data from SL7000
Hi,
Try to read 24 hours at the time. Set start and end time to midnight. There are some limitations in some SL7000 versions.
BR,
Mikko
Profile generic
Hi,
Thank you very much, now its working! In this case I cannot get back datetime values, only the data?
Best Regards,
László
Read profile generic data from SL7000
Hi,
DateTime is in byte arrays there. SL7000 is behaving badly and returning complex arrays back.
You can use GXDLMSClient.ChangeType to convert byte array to DateTime.
BR,
Mikko
Datetime
Thank you, this conversion is working, but: If I query 1 day of data (with 15 min density), I get an array with 96 elements back. The datetime is stored in the 0. index of every array element, but only the first array element contains the datetime value. In the other 95 cases the datetime value is nothing (null).
Do you have any idea why only the first element contains the datetime?
Thank you!
Datetime
Hi,
I forget this. Bytes are saved and datetime is set to null. :-)
You need to to add 15 mins for each row where date time is null.
BR,
Mikko