hello,
below code is for to read instantaneous and billing profile - - >
void
read_meter_instantaneous_profile()
{
gxProfileGeneric profile;
char * data = NULL;
cosem_init(&profile.base, DLMS_OBJECT_TYPE_PROFILE_GENERIC, "1.0.94.91.0.255");
com_read(&profile.base, 2);
/* Read rows by entry */
com_readRowsByEntry(&profile, 1, 2);
/* Read rows by Range */
// gxtime start_time;
// gxtime end_time;
// end_time.value = 1742302940; //EPOCH time
// start_time.value = end_time.value - 1 * 60 * 60;
// com_readRowsByRange(&profile, &start_time, &end_time);
obj_toString(&profile.base, &data);
obj_clear(&profile.base);
printk("DEBUG_METER_DATA : Meter Instantaneous Profile --- %s", data);
obj_clearProfileGenericBuffer(&profile.captureObjects);
obj_clearProfileGenericBuffer(&profile.buffer);
free(data);
}
-------------------------------------------------------------------------------------------------
void
read_meter_billing_profile()
{
gxProfileGeneric profile;
char * data = NULL;
cosem_init(&profile.base, DLMS_OBJECT_TYPE_PROFILE_GENERIC, "1.0.98.1.0.255");
com_read(&profile.base, 2);
/* Read rows by entry */
com_readRowsByEntry(&profile, 1, 1);
/* Read rows by Range */
// gxtime start_time;
// gxtime end_time;
// end_time.value = 1741768215; //EPOCH time
// start_time.value = end_time.value - 1 * 60 * 60; /* 12 hours */
// com_readRowsByRange(&profile, &start_time, &end_time);
obj_toString(&profile.base, &data);
obj_clear(&profile.base);
printk("DEBUG_METER_DATA : Meter Billing --- %s", data);
obj_clearProfileGenericBuffer(&profile.captureObjects);
obj_clearProfileGenericBuffer(&profile.buffer);
free(data);
}
we are able to read,
/* Read Logical Name "0.0.42.0.0.255" */
read_logical_name();
/* Read Serial No "0.0.96.1.0.255" */
read_meter_serial_no();
/* Read Device ID "0.0.96.1.2.25" */
read_deviceID_meter();
/* Read Meter Manufacturer "0.0.96.1.1.255" */
read_meter_manufacturer();
/* Read Meter Type "0.0.94.91.9.255" */
read_meter_type();
/* Read Meter Category "0.0.94.91.11.255" */
read_meter_category();
/* Read Firmware Version "1.0.0.2.0.255" */
read_meter_firmware_version();
/* Read Manufacturing Date "0.0.96.1.4.255" */
read_meter_manufacturing_date();
/*Read clock and set micro controller to use meter time if it's not set. "0.0.1.0.0.255" */
read_meter_clock();
/* Read Meter Daily Load Profile "1.0.99.2.0.255" */
read_meter_daily_load_profile();
/* Read Meter Block Load Profile "1.0.99.1.0.255" */
read_meter_block_load_profile();
-------------------------------------------------------------
com_read is getting failed , showing Invalid Object on terminal logs,
but when i connect with DLMSDirector, able to read data for billing and instantaneous profile.
Hi, Some meters don't…
Hi,
Some meters don't implement read rows by range to instantaneous and billing profile; you need to do it with a normal read.
BR,
Mikko
hi, i got stuck,since very…
hi,
i got stuck,since very long time in it.
can you just help me out with the piece of code, (how to do normal read for instantaneous and billing profile data)
so it is better for me to do further implementation.
hi, i tried with com_read,…
hi,
i tried with com_read, but it's getting failed.
Hi, com_read works for…
Hi,
com_read works for instantaneous profile. Make sure that you have connected with an authentication level that can access those objects.
BR,
Mikko