Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Can I Use Server Example Application In The Place of Actual Device?

Can I use server example application in the place of actual device?

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By pradson , 5 November, 2020
Forums
Gurux.DLMS

Hi Mikko,

I have integrated "Gurux.DLMS.cpp-master/GuruxDLMSClientExample" in my project. This application reads information periodically (interval basis like every 1 second or 2 seconds) from the meter. I want to test this client application with 1000+ actual devices but I have only 2 devices. Can I use "Gurux.DLMS.cpp-master/GuruxDLMSServerExample" application instead of actual device without any challenges?

Kindly suggest me asap.

Thanks & Regards,
Pradson

pradson

4 years 9 months ago

Hi,

Hi,

The readCaptureObjects is working fine but read buffer returns with empty string.

Please suggest.

Thanks,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 9 months ago

Dear Pradson,

Dear Pradson,

So you can read the data? Can you see the values if you read the real meter?

BR,
Mikko

pradson

4 years 9 months ago

In reply to Dear Pradson, by Kurumi

Yes, I am able to read actual

Yes, I am able to read actual meter with the same code.

Thanks,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 9 months ago

Hi,

Hi,

Can you send the simulated device template to me by email? I can check what is happening on Monday?

BR,
Mikko

pradson

4 years 9 months ago

In reply to Hi, by Kurumi

Sure, I will share simulated

Sure, I will share simulated device templet.

Please share me c# sample code to capture and update values of instantaneous-profile at simulator side.

Thanks & Regards,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 9 months ago

Hi,

Hi,

You haven't read the buffer as we spoke earlier here;
http://www.gurux.fi/comment/21743#comment-21743

Read buffer and you will see the values.
BR,
Mikko

pradson

4 years 9 months ago

In reply to Hi, by Kurumi

Hi Mikko,

Hi Mikko,

As per as my understanding, You had suggested me regarding to read all buffered data which is stored at the actual meter.

With the help of your suggestion( as mentioned link above), a template xml file will be generated and with the help of this template file, I will be able to create many simulated meters with same buffered data.

I don't want the buffered-data of simulated meter. My requirement is different-

For instantaneous profile object-
Request- The client sends a read request for the "current time" to simulated meter-
Response- The simulated meter should update and store(maintain only one record) the row which includes the clock(with system current time) along with all column values and send response string back to the client.

For block profile object-
NOTE-
The simulated meter should have a counter which update and store the row which include the clock(at every 5 minutes like 10:00, 10:05: 10:10, 10:15 etc...) along with all column values.

Request- The client send the readRowByRange(current date-time block range) to the simulated meter.
Response- The simulated meter should return the read response string or list of string to the client.

For daily profile object-
NOTE-
The simulated meter should have a counter which update and store the row which include the clock(at every midnight like 00:00:00) along with all column values.

Request- The client send the readRowByRange(current date-time range) to the simulated meter.
Response- The simulated meter should return the read response string or list of string to the client.

Apart from this, I have found clock object issue at simulator side. Actually, I am reading the clock object at every second from simulated meter using my client application. But after one or two days, the my client app shows the previous day clock time. To verify this I have tried the same simulated meter using GXDLMSdirector client tool, then I found same issue as well. Kindly look into this.

Thanks & Regards,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 9 months ago

Hi,

Hi,

For instantaneous profile object:
Invoke Reset and Capture for profile generic object when pre_read is called.
Reset will clear current values and Capture will generate a new row.

For block profile object:
If capture objects of the block profile object includes all the captured objects, you need to create a timer and this timer will call Capture.

For daily profile object.
Create a timer that calls Capture once a day.

I'll check this clock, but the current implementation returns the current time, so I believe that the reason is somewhere else.

BR,
Mikko

pradson

4 years 9 months ago

In reply to Hi, by Kurumi

HI Mikko,

HI Mikko,

I had sent the template of actual meter. Kindly check.

Still I am not able to read the current values of instantaneous profile object using my client application.
I am able to read only scalars values of the same.

Here I am sharing again the simulator side code as well as client side code. Kindly check. If any false in template which I had shared to you, then please help me regarding this.

//-------------------------------------------------
//Simulator side code.
//-------------------------------------------------
protected override void PreRead(ValueEventArgs[] args)
{
foreach (ValueEventArgs it in args)
{
if (Trace > TraceLevel.Warning)
{
System.Diagnostics.Debug.WriteLine("PreRead {0}:{1}", it.Target.LogicalName, it.Index);
}
//Update date-time of the clock object when client asks it.
if ((it.Target is GXDLMSClock c) && it.Index == 2)
{
c.Time = c.Now();
}

if ((it.Target is GXDLMSProfileGeneric ip) && it.Index == 2 && it.Target.LogicalName == "1.0.94.91.0.255")
{
ip.Reset(cl);
ip.Capture(cl);
}
}
}
//------------------------------------------------

//------------------------------------------------
//Client side code
//------------------------------------------------
CGXDLMSProfileGeneric* objIP = new CGXDLMSProfileGeneric("1.0.94.91.0.255");
ret = 0;
std::string sCapObj_IP;
if ((ret = comm.Read(objIP, 3, sCapObj_IP)) != 0)
{
printf("IP-capObj-> error[%s] failed to readCaptureObjects. \n", CGXDLMSConverter::GetErrorMessage(ret));
}

std::string sValues_IP;
if ((ret = comm.Read(objIP, 2, sValues_IP)) != 0) {
printf("IP-obj-> error[%s] failed to read register. \n", CGXDLMSConverter::GetErrorMessage(ret));
}

//----------------------

Thanks & Regards,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 9 months ago

Hi,

Hi,

Change lines:
ip.Reset(cl);
ip.Capture(cl);

to:

ip.Reset();
ip.Capture(this);

BR,
Mikko

pradson

4 years 9 months ago

HI Mikko,

HI Mikko,

Thanks a lot for your kind help. Now I am able to read the instantaneous profile object. I have gotten the capture objects and values string of instantaneous profile object as mentioned below. As you can see into the value string, most of the value fields are empty. How could I fill these values using simulator?
Please suggest same as well.

//---------------Capture objects of instantaneous profile object------------------------
[0.0.1.0.0.255, 1.0.31.7.0.255, 1.0.51.7.0.255, 1.0.71.7.0.255, 1.0.32.7.0.255, 1.0.52.7.0.255, 1.0.72.7.0.255, 1.0.33.7.0.255, 1.0.53.7.0.255, 1.0.73.7.0.255, 1.0.13.7.0.255, 1.0.14.7.0.255, 1.0.9.7.0.255, 1.0.1.7.0.255, 1.0.3.7.0.255, 1.0.1.8.0.255, 1.0.2.8.0.255, 1.0.9.8.0.255, 1.0.10.8.0.255, 0.0.96.7.0.255, 0.0.94.91.8.255, 0.0.94.91.0.255, 0.0.0.1.0.255, 0.0.96.2.0.255, 0.0.0.1.2.255, 1.0.36.7.0.255, 1.0.56.7.0.255, 1.0.76.7.0.255, 1.0.128.7.38.255, 1.0.128.7.39.255, 1.0.128.7.40.255, 1.0.128.7.41.255, 1.0.128.7.53.255, 1.0.128.7.54.255, 1.0.128.7.55.255, 1.0.128.7.45.255, 1.0.128.7.35.255, 1.0.128.7.36.255, 1.0.128.7.37.255, 1.0.128.7.46.255, 1.0.128.8.28.255, 1.0.128.7.43.255, 1.0.128.8.29.255, 1.0.128.7.44.255, 1.0.128.8.34.255, 1.0.128.7.49.255, 1.0.128.7.68.255, 1.0.128.7.65.255, 1.0.128.7.66.255, 1.0.128.7.67.255, 1.0.128.7.72.255, 1.0.128.7.69.255, 1.0.128.7.70.255, 1.0.128.7.71.255, 1.0.128.7.17.255, 1.0.128.7.21.255, 1.0.128.7.18.255, 1.0.128.7.22.255, 1.0.128.7.19.255, 1.0.128.7.23.255, 1.0.5.8.0.255, 1.0.6.8.0.255, 1.0.7.8.0.255, 1.0.8.8.0.255, 1.0.16.8.0.255, 1.0.128.7.149.255, 1.0.128.8.7.255, 1.0.128.8.8.255, 1.0.128.8.9.255, 1.0.128.8.10.255, 1.0.128.8.11.255, 1.0.128.8.12.255, 1.0.128.8.13.255, 1.0.128.8.14.255, 1.0.128.8.190.255, 1.0.128.8.191.255, 1.0.128.8.192.255, 1.0.128.8.193.255]

//---------------Value string of instantaneous profile object------------------------
9/8/2021 00:53:04 | 0 | 0 | 0 | 66 | 66 | 66 | 1 | 1 | 1 | 1 | 50 | 51 | 39 | 33 | 85807 | 1 | 110880 | 3 | 5 | 73456 | 15 | 11 | 97 | 07 E5 08 01 FF 00 00 FF FF 80 00 00 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 70146 | | | 1 | | | | | | | | | | | | | | |

Thanks & Regards,
Pradson

pradson

4 years 9 months ago

In reply to HI Mikko, by pradson

Hi Mikko,

Hi Mikko,

Kindly help regarding the same.

Thanks

pradson

4 years 9 months ago

Hi Mikko,

Hi Mikko,

I am awaiting for your response.

Thanks,

Profile picture for user Kurumi

Kurumi

4 years 9 months ago

Hi Pradson,

Hi Pradson,

The easiest way to handle empty fields is to update new values after you have load the template from the file.
You need to loop all cells in the buffer of profile generic and set correct values.

BR,
Mikko

pradson

4 years 9 months ago

In reply to Hi Pradson, by Kurumi

Hi,

Hi,

Thanks a lot for kind help.

I have another a query regarding simulator clock. I have run the simulator with 10 meters in my machine and my client is also running in the same machine and fetching instantaneous profile data at every second.

I think simulator should return same time format as machine have In my case my machine time format is 24Hrs but simulator is showing time in 12Hrs(AM/PM) format.

For example- Currently my machine time is 13:41 but at the same time simulator is showing 01:41.

Kindly suggest how should I handle the simulator's clock so that I could get the same time format from the simulator as machine have.

Thanks & Regards,
Pradson

pradson

4 years 8 months ago

Hi Mikko,

Hi Mikko,

I am awaiting for your response. Kindly help.

Thanks,

pradson

4 years 8 months ago

Hi,

Hi,

Please suggest, I am awaiting for your response.

Thanks,

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi Pradson,

Hi Pradson,

I'm sorry, but I don't understand. Where the simulator is showing time in 12Hrs? Are you showing the date-time in the console?
BR,
Mikko

pradson

4 years 8 months ago

In reply to Hi Pradson, by Kurumi

Hi Mikko,

Hi Mikko,

Yes, I have printed the instantaneous profile string value in the the console. Kindly refer below mentioned code.

// Code***********************************************************************************
std::string sValues_IP;
if ((ret = comm.Read(objIP, 2, sValues_IP)) != 0) {
printf("IP-obj-> error[%s] failed to read register. \n", CGXDLMSConverter::GetErrorMessage(ret));
}
else {
printf("%s", (char*)sValues_IP.c_str());
}
//***********************************************************************************

I am getting the below mentioned string-
9/8/2021 00:53:04 | 0 | 0 | 0 | 66 | 66 | 66 | 1 | 1 | 1 | 1 | 50 | 51 | 39 | 33 | 85807 | 1 | 110880 | 3 | 5 | 73456 | 15 | 11 | 97 | 07 E5 08 01 FF 00 00 FF FF 80 00 00 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 70146 | | | 1 | | | | | | | | | | | | | | |

But at the same time, my simulator machine time is "9/8/2021 12:53:04"

So, here I am getting the difference of 12 Hrs. The expected time from simulator should be its machine time.

Kindly suggest regarding same.

Thanks & Regards,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi Pradson,

Hi Pradson,

This is tested and it worked like expected. Are you calling the capture of the profile generic for the meter or are you settings the time by yourself?

BR,
Mikko

pradson

4 years 8 months ago

Hi,

Hi,

As suggested by you, I have called the capture method in the PreRead() method at the simulator.
Whenever I read the instantaneous profile object using client code, I am getting the same time difference (12 Hrs) issue. Kindly suggest what should I do.

Kindly check below mentioned code of simulator as well as client side-
//-------------------------------------------------
//Simulator side code.
//-------------------------------------------------
protected override void PreRead(ValueEventArgs[] args)
{
foreach (ValueEventArgs it in args)
{
if (Trace > TraceLevel.Warning)
{
System.Diagnostics.Debug.WriteLine("PreRead {0}:{1}", it.Target.LogicalName, it.Index);
}
//Update date-time of the clock object when client asks it.
if ((it.Target is GXDLMSClock c) && it.Index == 2)
{
c.Time = c.Now();
}

if ((it.Target is GXDLMSProfileGeneric ip) && it.Index == 2 && it.Target.LogicalName == "1.0.94.91.0.255")
{
ip.Reset();
ip.Capture(this);
}
}
}
//------------------------------------------------

//------------------------------------------------
//Client side code
//------------------------------------------------
CGXDLMSProfileGeneric* objIP = new CGXDLMSProfileGeneric("1.0.94.91.0.255");
ret = 0;
std::string sCapObj_IP;
if ((ret = comm.Read(objIP, 3, sCapObj_IP)) != 0)
{
printf("IP-capObj-> error[%s] failed to readCaptureObjects. \n", CGXDLMSConverter::GetErrorMessage(ret));
}

std::string sValues_IP;
if ((ret = comm.Read(objIP, 2, sValues_IP)) != 0) {
printf("IP-obj-> error[%s] failed to read register. \n", CGXDLMSConverter::GetErrorMessage(ret));
}

//----------------------

Thanks,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi,

Hi,

Try to create only one meter. Is the date-time now correct when you read it? Is the date-time correct with GXDLMSDirctor? This works like should be when I just tested it again.

What is your time zone if you select clock object?

BR,
Mikko

pradson

4 years 8 months ago

In reply to Hi, by Kurumi

HI Mikko,

HI Mikko,

As suggested I have tried. Kindly find the below information and suggest.

(1) Try to create only one meter. Is the date-time now correct when you read it?
I have created one meter and tried still I am getting same time difference (12Hrs).

At the time when client read simulated meter-

System time: 22-9-2021 15:28:36

Fetched value string of instantaneous-profile-
22-9-2021 03:28:36 | 0 | 0 | 0 | 66 | 66 | 66 | 1 | 1 | 1 | 1 | 50 | 51 | 39 | 33 | 85807 | 1 | 110880 | 3 | 5 | 73456 | 15 | 11 | 97 | 07 E5 08 01 FF 00 00 FF FF 80 00 00 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 70146 | | | 1 | | | | | | | | | | | | | | |

(2) Is the date-time correct with GXDLMSDirctor?
No, even the same time differenence(12Hrs) is appearing in GXDLMDDirector client app when I read simulated meter. Kindly refer attachged image.

(3) What is your time zone if you select clock object?
Kindly refer below information related to time zone-

Time Zone
Asia/Kolkata

Current Date and Time in Asia/Kolkata
Wed 22-Sep-2021 03:39 P.M.

Country
India

Daylight Saving Time (DST) in effect?
No

Most Recent DST Transition
DST ended on Mon 15-Oct-1945 at 12:00:00 A.M. when local clocks were set backward 1 hour

Next Scheduled DST Transition
There are no future Daylight Saving Time rules for this time zone.

12:00:00 A.M = MIDNIGHT
12:00:00 P.M. = NOON

Thanks & Regards,
Pradson

Image
Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi,

Hi,

I believe that you have select "Use UTC time zone, not standard" at the device settings.

Get the latest version from the simulator. You need to start the simulator -d India parameter and simulator will use UTC to Normal time. You can read more from this:
http://gurux.fi/Gurux.DLMS.Objects.GXDLMSClock#deviation

BR,
Mikko

pradson

4 years 8 months ago

In reply to Hi, by Kurumi

Hi Mikko,

Hi Mikko,

I am using latest version and I have already set "settings.client.UseUtc2NormalTime = true;" at device setting side. Even I am getting this (12Hrs) time difference at client side.

I have tried to set the parameter "cl.SetUseUtc2NormalTime(true);" with both(true and false) at client side but I am getting same time differences(12 Hrs).

Please suggest.

Thanks & Regards,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi Pradson,

Hi Pradson,

You need to add that -d India parameter for the simulator. You need to use UseUtc2NormalTime also on the server-side. I believe that now the client is using it and the server doesn't. Change also
c.Time = DateTime.Now;

BR,
Mikko

pradson

4 years 8 months ago

In reply to Hi Pradson, by Kurumi

Hi Mikko,

Hi Mikko,

Thanks a lot for suggesting me. Now I am able to see the system time format in "Clock" and "instantaneous-profile" value string at client side. Its working properly as required.

I have another question regarding value strings of block-profile object. I have implement a timer for block-profile object. This timer captures block-profile object at every minute( Required is at every 5/15 Min but taking 1 minute for example). Kindly refer below mentioned code.

Whenever I read block-profile object using ReadRowByRange() method, then I get the value strings. Kindly refer value string below-
//---------- Value strings------------------------
23-9-2021 03:12:56 | | | | | | | | | | | | | | | | |
23-9-2021 15:13:11 | | | | | | | | | | | | | | | | |
23-9-2021 15:14:11 | | | | | | | | | | | | | | | | |
23-9-2021 15:15:11 | | | | | | | | | | | | | | | | |
//---------------------------------------------

I have two questions regarding value strings-

(1) The time format of the first value string does not match with system time. Even I have used "DateTime dt = DateTime.Now;" statement in the device side. The others strings have proper time format. Kindly suggest for first value string so that I could get proper system format at client side for all value strings.

(2) I am getting all values empty except clock. Why is it happening like this? How could I fill values at device side? Please suggest.

//---device side Code- timer method for block-profile. --------------------
private void Tick(object sender)
{
DateTime dt = DateTime.Now;
int min = dt.Minute;
if (min != prevMin && min >= 0 && min < 60)
{
GXDLMSClock c = (GXDLMSClock)Items.FindByLN(ObjectType.Clock, "0.0.1.0.0.255");
c.Time = DateTime.Now;

GXDLMSProfileGeneric blpObj = (GXDLMSProfileGeneric)Items.FindByLN(ObjectType.ProfileGeneric, "1.0.99.1.0.255");
blpObj.Capture(this);
prevMin = min;
}
}
//------------------------------------------------------------

Thanks & Regards,
Pradson

pradson

4 years 8 months ago

Hi Mikko,

Hi Mikko,

Please suggest. I am awaiting for your response.

Thanks,

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi Pradson,

Hi Pradson,

Date-time is not a string. You need to save it as an octet string where is date-time. The framework does this automatically when you add clock object as captured object list as the first object.

You need to fill captured object list so values are filled into the buffer.
Captured object list includes all values that are saved to the buffer.

http://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSProfileGeneric
BR,
Mikko

pradson

4 years 8 months ago

In reply to Hi Pradson, by Kurumi

Hi Mikko,

Hi Mikko,

Thanks a lot for suggesting me.

pradson

4 years 8 months ago

Hi Mikko,

Hi Mikko,

At client side, I am facing challenge to read block-profile object using ReadRowByRange() method. Even I am capturing block-profile object at every 5minutes with the help of a timer at simulator side. This timer captures block-profile object at every 5 minutes (for ex. at 16:15, 16:20, 16:25, 16:30, 16:35 etc.)

As you had suggested me regarding use this "UseUtc2NormalTime" flag to true at both end(server as well as client). I have done the same at both ends. I have also used -d India parameter for the simulator. Even I have used "c.Time = DateTime.Now;" for the clock at server side. I am able to read the clock and instantaneous-profile at client side. I get system time and its format for both clock and instantaneous-profile.

But in case of block-profile, whenever I read for a selected block range of block-profile object using ReadRoeByRange() method, then I get empty records. If I select big range, then I get the records beyond the range. I am unable to know what is happening in this case. Kindly help regarding same. I am sharing the client and server side code. Please refer and suggest-

Server side code-
//------------------------------------------------------
// For block-profile, the timer is capturing at every 5 minutes.
//-------------------------------------------------------
private void Tick_blockProfile(object sender)
{
DateTime dt = DateTime.Now;
string str = dt.ToString("dd-MM-yyyy HH:mm");
dt = DateTime.Parse(str);
int min = dt.Minute;
int divOfMin = min % 5;

if (min != prevMin_blp && divOfMin == 0)
{
GXDLMSClock c = (GXDLMSClock)Items.FindByLN(ObjectType.Clock, "0.0.1.0.0.255");
c.Time = dt;

GXDLMSProfileGeneric blpObj = (GXDLMSProfileGeneric)Items.FindByLN(ObjectType.ProfileGeneric, "1.0.99.1.0.255");
if (prevMin_blp == -1) {
blpObj.Reset();
}
blpObj.Capture(this);
prevMin_blp = min;
Console.WriteLine("Block-profile captured--> \t" + str, true);
}
}

//@@@@@@@@@@@@@
// Out put
//@@@@@@@@@@@@@
Block-profile captured--> 30-09-2021 16:15
Block-profile captured--> 30-09-2021 16:20
Block-profile captured--> 30-09-2021 16:25
Block-profile captured--> 30-09-2021 16:30
Block-profile captured--> 30-09-2021 16:35
Block-profile captured--> 30-09-2021 16:40
Block-profile captured--> 30-09-2021 16:45
Block-profile captured--> 30-09-2021 16:55
Block-profile captured--> 30-09-2021 17:00
Block-profile captured--> 30-09-2021 17:05
//@@@@@@@@@@@
//-------------------------------------------------------

client side code-
//---------------------------------------
CGXDateTime startLP1 = CGXDateTime(2021, 9, 30, 16, 40, 0, 0);
CGXDateTime endLP1 = CGXDateTime(2021, 9, 30, 16, 40, 0, 0);

tm LP11 = startLP1.GetValue();
CGXDLMSVariant rows;
if ((ret = comm.ReadRowsByRange(objLP1, startLP1, endLP1, rows)) != 0) {
printf("err! failed to read register: %s \n", CGXDLMSConverter::GetErrorMessage(ret));
}
else {
printf("BLP Obj-> [%s] \n", (char*)rows.ToString().c_str());
}

//@@@@@@@@@@@@@@@@
// Out put - found no record
//@@@@@@@@@@@@@@@@
BLP Obj-> []
//@@@@@@@@@@@@@@@@

Note- If Pass range around 10 to 15 hours, then I get records beyond the range.
//----------------------------------------

Kindly suggest where should I add something-

Thanks & Regards,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi,

Hi,

Is the first object clock in block-profile? I can check this if you can share the simulated template in textbin.net.

BR,
Mikko

pradson

4 years 8 months ago

In reply to Hi, by Kurumi

Hi Mikko,

Hi Mikko,

Yes, its first object clock of block-profile. Can I email you the simulated template.xml ?

Thanks,

pradson

4 years 8 months ago

Hi Mikko,

Hi Mikko,

I have sent simulated templet file of the real meter through email. Kindly check and suggest the solution for the same.

Thanks,
Pradson

pradson

4 years 8 months ago

Hi Mikko,

Hi Mikko,

Kindly suggest. I am awaiting for your response.

Thanks,

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi,

Hi,

The simulator is now improved and it will capture profile generic objects automatically if the capture period is set. There are also objects in profile generic capture objects that are not in the association view. Those objects are added to the object list so they are easier to hande.

BR,
Mikko

pradson

4 years 8 months ago

In reply to Hi, by Kurumi

Hi Mikko,

Hi Mikko,

Thanks a lot for useful information.

Is simulator available in C++ now? As you had said that it would be available in October 2021.

Thanks,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi,

Hi,

ANSI C++ version is waiting for testing, but I can't say when tests can start. Security Suite 1 has caused that it's delayed.

BR,
Mikko

pradson

4 years 8 months ago

HI Mikko,

HI Mikko,

I have checked with latest simulator but still my problem is not resolved as I have mentioned earlier. My Machine time and format is "11-10-2021 16:09:09" at same time I have connected to the simulator and read clock, instantaneous-profile and block-profile objects. I am getting the fallowing results-

For clock object [11-10-2021 16:09:09]
For Instantaneous-profile-
IP[11-10-2021 04:09:09 | 0 | 0 | 0 | 66 | 66 | 66 | 1 | 1 | 1 | 1 | 50 | 51 | 39 | 33 | 85807 | 1 | 110880 | 3 | 5 | 73456 | 15 | 11 | 97 | 07 E5 08 01 FF 00 00 FF FF 01 4A 00 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 70146 | | | 1 | | | | | | | | | | | | | | |]

For block profile- no records found for selected period.

I would like to share client side request and response. Kindly suggest how could I get buffer data for a selected range with same time format as machine has.

//-----------------------------
//Client side code
//-----------------------------
/************************* read clock ************************************/
CGXDLMSClock* objClock = new CGXDLMSClock("0.0.1.0.0.255");
std::string sValues_Cl;

if ((ret = comm.Read(objClock, 2, sValues_Cl)) != 0) {
printf("Clock-> error[%s] failed to read clock object. \n", CGXDLMSConverter::GetErrorMessage(ret));
}
else {
printf("Clock[%s]. \n", (char*)sValues_Cl.c_str());
}

@@@@ Result @@@@@@@@@@@@@@
Clock[11-10-2021 16:09:09].
@@@@@@@@@@@@@@@@@@@@@@

//************************************ Instantaneous-profile *********************************
CGXDLMSProfileGeneric* objIP = new CGXDLMSProfileGeneric("1.0.94.91.0.255");
ret = 0;
std::string sValues_IP;
if ((ret = comm.Read(objIP, 2, sValues_IP)) != 0) {
printf("IP-obj-> error[%s] failed to read register. \n", CGXDLMSConverter::GetErrorMessage(ret));
}
else {
printf("IP[%s] \n", (char*)sValues_IP.c_str());
}

@@@@ Result @@@@@@@@@@@@@@
IP[11-10-2021 04:09:09 | 0 | 0 | 0 | 66 | 66 | 66 | 1 | 1 | 1 | 1 | 50 | 51 | 39 | 33 | 85807 | 1 | 110880 | 3 | 5 | 73456 | 15 | 11 | 97 | 07 E5 08 01 FF 00 00 FF FF 01 4A 00 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 70146 | | | 1 | | | | | | | | | | | | | | |]
@@@@@@@@@@@@@@@@@@@@@@

//************************************ Block-profile *********************************
CGXDLMSProfileGeneric* objLP1 = new CGXDLMSProfileGeneric("1.0.99.1.0.255");// 5 Min profile

CGXDateTime startLP1 = CGXDateTime(2021, 10, 11, 15, 30, 0, 0);
CGXDateTime endLP1 = CGXDateTime(2021, 10, 11, 16, 0, 0, 0);

tm LP11 = startLP1.GetValue();
CGXDLMSVariant rows;
if ((ret = comm.ReadRowsByRange(objLP1, startLP1, endLP1, rows)) != 0) {
printf("err! failed to read register: %s \n", CGXDLMSConverter::GetErrorMessage(ret));
}
else {
printf("BLP [%s] \n", (char*)rows.ToString().c_str());
}

@@@@ Result @@@@@@@@@@@@@@
BLP [] // The records are not found for selected period even simulator is running for 2 hrs.
@@@@@@@@@@@@@@@@@@@@@@
//----------------------------

Thanks & Regards,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi Pradson,

Hi Pradson,

Do you have any rows in the block profile? Are you getting the result if you read all data like this?

std::string tmp;
ret = comm.Read(objLP1, 2, tmp);

BR,
Mikko

pradson

4 years 8 months ago

Hi Mikko,

Hi Mikko,

Yes, I have rows in the block profile. I have read clock, Instantaneous profile and block profile. Kindly resolve below mentioned points-

(1)
My machine time and its format is expected In each profile's row clock (or first column of the record) and clock object. But only clock object is matching with my machine time and it's format. The other block and instantaneous profile has different format (say AM/PM format). Kindly refer the below mentioned results of the actions.

(2)
The ReadRowByRange() method is not returning records for the selected range. I have tried with both formats 12 Hrs. or 24 Hrs. but the Read() method is working properly. Kindly refer below mentioned results as well as its action.

(3)
The first record of the block profile should log according to the capture period like 17:45, 17:50, 17:55 etc. but its appearing 05:44 in first record. The minute must be 45.

@@@@@@@@@@@@@@@@@Action and results@@@@@@@@@@@@@@@@@

Clock---------------------------------------------------------
CGXDLMSClock* objClock = new CGXDLMSClock("0.0.1.0.0.255");
std::string sValues_Cl;
ret = comm.Read(objClock, 2, sValues_Cl)
Result- [11-10-2021 18:07:15]

Instantaneous profile---------------------------------------------------------
CGXDLMSProfileGeneric* objIP = new CGXDLMSProfileGeneric("1.0.94.91.0.255");
std::string sValues_IP;
ret = comm.Read(objIP, 2, sValues_IP)

Result-
[11-10-2021 06:07:16 | 0 | 0 | 0 | 66 | 66 | 66 | 1 | 1 | 1 | 1 | 50 | 51 | 39 | 33 | 85807 | 1 | 110880 | 3 | 5 | 73456 | 15 | 11 | 97 | 07 E5 08 01 FF 00 00 FF FF 01 4A 00 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 70146 | | | 1 | | | | | | | | | | | | | | |]

Block profile---------------------------------------------------------
CGXDLMSProfileGeneric* objLP1 = new CGXDLMSProfileGeneric("1.0.99.1.0.255");// 15 Min profile
CGXDateTime startLP1 = CGXDateTime(2021, 10, 11, 17, 30, 0, 0);
CGXDateTime endLP1 = CGXDateTime(2021, 10, 11, 18, 30, 0, 0);

(or)

CGXDateTime startLP1 = CGXDateTime(2021, 10, 11, 5, 30, 0, 0);
CGXDateTime endLP1 = CGXDateTime(2021, 10, 11, 6, 30, 0, 0);

NOTE---- I have tried both range as mentioned above.

ret = comm.ReadRowsByRange(objLP1, startLP1, endLP1, rows)
Result- No Records found

std::String tmp;
ret = comm.Read(objLP1, 2, tmp);

Result-
[
11-10-2021 05:44:30 | | | | | | | | | | | | | | | | |
11-10-2021 05:50:00 | | | | | | | | | | | | | | | | |
11-10-2021 05:55:00 | | | | | | | | | | | | | | | | |
11-10-2021 06:00:00 | | | | | | | | | | | | | | | | |
11-10-2021 06:05:00 | | | | | | | | | | | | | | | | |
]

Thanks & Regards,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi Pradson,

Hi Pradson,

The capture period in the template that you send to me is 10 seconds. You need to change that to 600 if you want those values to be captured every 10 minutes.

It is not possible that the other block and instantaneous profile have different date-time formats. I tested this with the template that you send and it worked like expected. Are you adding rows manually.

pradson

4 years 8 months ago

In reply to Hi Pradson, by Kurumi

Hi Mikko,

Hi Mikko,

The block profile has 300 (5 minute) capture period as mentioned below templet section which I have shared to you. The templet does not have 10 seconds capture period for any profile. I have mentioned only 300 capture period for block profile and 86400 for daily profile and others configure with 0 capture period in the templet file. I think, you have tested with different templet file. Kindly check once if required I will share again please let me know accordingly.

I have not added rows manually for the block or other profile. The rows are being added according its capture period automatically which is 300 Milliseconds (5 minutes).

In my case, there are fallowing time formats are showing for the clock object and profiles as I have already shared to you in the previous post-
The clock is showing "[11-10-2021 18:07:15]" date time format(24 Hrs format).
The instantaneous profile is showing "[11-10-2021 06:07:16 ]" date time format(12 Hrs format).
The instantaneous profile is showing "[11-10-2021 05:50:00 ]" date time format(12 Hrs format).

The expected time format will be the machine time format which I have set "11-10-2021 18:07:15" i.e. 24 Hrs. format.

Kindly check once and suggest.

------------ Templet---------------
<GXDLMSProfileGeneric>
<LN>1.0.99.1.0.255</LN>
<Version>1</Version>
<Description>BlockLoad Profile</Description>
<Access>11111111</Access>
<MethodAccess>00</MethodAccess>
<Buffer />
<CaptureObjects>
............
</CaptureObjects>
<CapturePeriod>300</CapturePeriod>
<SortMethod>1</SortMethod>
<SortObject />
<EntriesInUse>8640</EntriesInUse>
<ProfileEntries>8640</ProfileEntries>
</GXDLMSProfileGeneric>
----------------------------------

Thanks,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi Pradson,

Hi Pradson,

Instantaneous profile 1.0.94.91.0.255:
The period is zero so that is not called automatically. Are the values correct if you press "Capture" button in the GXDLMSDirector? Try this with clean version where are no your changes.

Block Load profile 1.0.99.1.0.255:

This is fixed. It was possible that capture was not called. Get the latest version from GitHub.

BR,
Mikko

pradson

4 years 8 months ago

In reply to Hi Pradson, by Kurumi

Hi Mikko,

Hi Mikko,

I have checked the upgraded "Gurux.DLMS.Simulator.Net" version with my client app. The time format issue has been resolved. Now the machine time format is appearing in the clock and profiles. But still I am facing below mentioned challenges-

(1) Unable to fetch data of block profile for a single block using method "ReadRowByRange" however data is available. Kindly refer below mentioned block profile data records. The block of 17:45:00 is available but the method "ReadRowByRange" is unable to fetch single record. Kindly refer below mentioned example-

CGXDateTime startLP1 = CGXDateTime(2021, 10, 14, 17, 45, 0, 0);
CGXDateTime endLP1 = CGXDateTime(2021, 10, 14, 17, 45, 0, 0);
CGXDLMSVariant rows;
comm.ReadRowsByRange(objLP1, startLP1, endLP1, rows)
Result: rows has no records.

But if pass from 2021-10-14 17:45:00 to 2021-10-14 17:50:00, the get single record of 17:45. In this case 2 records 17:45 and 17:50 should have fetched. Kindly check and suggest.

(2) As a requirement, the time up to minute should have captured for profile object except instantaneous profile and clock object. Kindly look into the below mentioned block profile data, the 3rd data row has been captured at second level 17:40:01. If the capture period is 5 minute, then all records should have captured up to minute level like 17:35:00, 17:40:00, 17:45:00, 17:50:00, 17:55:00... etc. etc. How could I achieve the same? I have tried but failed.

(3) The first row of the block profile data does not fallow the capture period rule. Kindly refer below mentioned block profile data. The time of 1st row is 17:32:02, this block should not have captured. The upcoming block 17:35:00 should have captured because capture period is 5 minute. So how could I achieve the same?

Kindly suggest regarding above points.

------------------- Block profile data rows-----------------------
13-10-2021 17:32:02 | | | | | | | | | | | | | | | | |
13-10-2021 17:35:00 | | | | | | | | | | | | | | | | |
13-10-2021 17:40:01 | | | | | | | | | | | | | | | | |
13-10-2021 17:45:00 | | | | | | | | | | | | | | | | |
13-10-2021 17:50:00 | | | | | | | | | | | | | | | | |
13-10-2021 17:55:00 | | | | | | | | | | | | | | | | |
------------------------------------------------------------

Thanks & Regards,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi Pradson,

Hi Pradson,

1. Reading one value will fail if milliseconds are not zero. In the latest version of the simulator, milliseconds are set to zero.

2 and 3. Capture is called every 5 minutes. Saved time is the time when a new row is added. I realized that Run returns wait time in seconds. This causes problems if milliseconds are near to the next second. I check if the return value should be changed from seconds to milliseconds.

There is an update in the simulator. Get the latest version.

BR,
Mikko

pradson

4 years 8 months ago

In reply to Hi Pradson, by Kurumi

HI Mikko,

HI Mikko,

I have checked with upgraded version but still I am facing same challenges as I have faced previously.

(1) Observations of Read() method-
I have read block profile data using Read() method, then I have found below mentioned records-

----------------- Data of Block Profile through Read() method----------
15-10-2021 00:52:53 | | | | | | | | | | | | | | | | |
15-10-2021 00:55:01 | | | | | | | | | | | | | | | | |
15-10-2021 01:05:00 | | | | | | | | | | | | | | | | |
15-10-2021 01:10:00 | | | | | | | | | | | | | | | | |
----------------------------------------------------------------
NOTE- The first records "15-10-2021 00:52:53" should not have captured because its not a 5 minute block data. The first record should have "15-10-2021 00:55:00". How could I ignore first block to be captured if it is not a 5 minute block data? Kindly suggest.

Expected records should have captured like this-
----------------------------------
15-10-2021 00:55:00 | | | | | | | | | | | | | | | | |
15-10-2021 01:05:00 | | | | | | | | | | | | | | | | |
15-10-2021 01:10:00 | | | | | | | | | | | | | | | | |
----------------------------------

(2) Observation of ReadRowByRange() method-
I have passed the from range 15-10-2021 01:05:00 and to range 15-10-2021 01:05:00 to read a single block data, then still I have not found any records.

I think if I set the second and milliseconds to zero, then it will be possible to achieve the expectation.

Kindly suggest for both cases.

Thanks
Pradson

Profile picture for user Kurumi

Kurumi

4 years 7 months ago

Hi Pradson,

Hi Pradson,

1. Profile generic makes the captures after power-up. You can remove that after you have start the meter.

2. Have you start the simulator with -d India parameter? What if the end time is 15-10-2021 01:06:00? Can you see the result?

BR,
Mikko

pradson

4 years 7 months ago

In reply to Hi Pradson, by Kurumi

Hi Mikko,

Hi Mikko,

Kindly find the reply against the given points-

Have you start the simulator with -d India parameter?
Yes, I have started with -d India.

What if the end time is 15-10-2021 01:06:00?
Actually, I have seen In the real meter that the real meter captures the block data at sharp 5 minute like 01:05:00, 01:10:00, 01:15:00 and so on if capture period is 5 Minute. That's the reason I want to create a virtual meter which will appear like real one.

Kindly suggest.

Thanks,
Pradson

Profile picture for user Kurumi

Kurumi

4 years 7 months ago

Hi Pradson,

Hi Pradson,

What I mean is have you try to read the data with ReadRowByRange where start time is 15-10-2021 01:05:00 and end time is 15-10-2021 01:06:00?

The reason why I asked this is that this works like expected in the test PCs. Can you try to read this with GXDLMSDirector where start time is 01:05:00 and end time is 01:06:00?

BR,
Mikko

Pagination

  • First page
  • Previous page
  • Page 1
  • Page 2
  • Page 3
  • Next page
  • Last page
  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin