I am trying to read profile generic over Serial using ANSI C
My code is as below.
ret = com_readProfileGenericColumns();
oa_init(&objects);
ret = oa_getObjects(&settings.objects, DLMS_OBJECT_TYPE_PROFILE_GENERIC, &objects);
ret = com_read((gxObject*)pg, 3);
ret = com_read((gxObject*)pg, 2);
for(pos=0;pos!=objects.size;pos++)
{
ret = oa_getByIndex(&objects, pos, (gxObject**)&pg);
ret = com_read((gxObject*)pg, 7);
ret = com_read((gxObject*)pg, 8);
ret = com_readRowsByEntry((gxObject*)pg, 1, 1);
}
How to get All Columns and Rows values for profile generic after this?
Is this Correct sequence to read Profile generic?
for example;
OBIS Code 0.0.94.91.10.255 in profile generic,Inside that there are number of columns as below
0.0.96.1.0.255,
0.0.96.1.1.255,
1.0.0.2.0.255,
0.0.94.91.9.255,
0.0.94.91.11.255,
0.0.94.91.12.255,
1.0.0.4.2.255,
1.0.0.4.3.255,
0.0.96.1.4.255
Now,I would like to read 10 rows.
Then I want to iterate each one of them and print obis code and value on the serial port.
how to parse the data buffer for the objects ?.
First you need to read columns.
ret = com_read((gxObject*)pg, 3);
If you want to read all the data from the PG use this:
ret = com_read(BASE(pg), 2);
If you want to read 10 rows use this:
ret = com_readRowsByEntry(BASE(pg), 1, 10);
If you want to read using start and end time use com_readRowsByRange.
Check obj_rowsToString method. It converts all columns to string.
Hi,
Hi,
First you need to read columns.
ret = com_read((gxObject*)pg, 3);
If you want to read all the data from the PG use this:
ret = com_read(BASE(pg), 2);
If you want to read 10 rows use this:
ret = com_readRowsByEntry(BASE(pg), 1, 10);
If you want to read using start and end time use com_readRowsByRange.
Check obj_rowsToString method. It converts all columns to string.
BR,
Mikko