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.
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.
Hi Mikko,
Hope you are doing good. We are observing strange problem in com_read function. At times com_read returns error code DLMS_ERROR_CODE_INVALID_PARAMETER i.e in decimal 258. I remember this problem was resolved in stack(https://www.gurux.fi/node/16144) and we are using the latest ANSCI C library only. could you please tell us what is the problem?
Below is the code snippet
read_data()
{
cosem_init()
com_read(&con, profile_obj, 3);
com_read(&con, profile_obj, 2);
}
Below is the trace of TX and RX.
TX : 7E A0 19 03 41 BA 7A B5 E6 E6 00 C0 01 81 00 07 01 00 5E 5B 00 FF 03 00 4C 96 7E
RX : 7E A8 89 41 03 DA 8B A4 E6 E7 00 C4 01 81 00 01 16 02 04 12 00 08 09 06 00 00 01 00 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 0C 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 0B 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 5B 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 0D 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 0E 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 09 07 25 5C 7E
TX : 7E A0 07 03 41 D1 4C 05 7E
RX : 7E A8 89 41 03 DC BD C1 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 01 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 01 08 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 09 08 00 FF 0F 02 12 00 00 02 04 12 00 04 09 06 01 00 01 06 00 FF 0F 02 12 00 00 02 04 12 00 04 09 06 01 00 01 06 00 FF 0F 05 12 00 00 02 04 12 00 04 09 06 01 00 09 06 00 FF 0F 02 12 00 00 02 04 12 00 04 09 06 01 00 09 06 00 FF 8C FE 7E
TX : 7E A0 07 03 41 F1 4E 24 7E
RX : 7E A8 89 41 03 DE AF E2 0F 05 12 00 00 02 04 12 00 03 09 06 00 00 5E 5B 0E FF 0F 02 12 00 00 02 04 12 00 01 09 06 00 00 5E 5B 00 FF 0F 02 12 00 00 02 04 12 00 01 09 06 00 00 00 01 00 FF 0F 02 12 00 00 02 04 12 00 01 09 06 00 00 60 02 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 02 08 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 0A 08 00 FF 0F 02 12 00 00 02 04 12 00 46 09 06 00 00 60 03 0A FF 0F 02 93 3D 7E
TX : 7E A0 07 03 41 11 40 C3 7E
RX : 7E A0 1E 41 03 D0 1F E8 12 00 00 02 04 12 00 47 09 06 00 00 11 00 00 FF 0F 03 12 00 00 52 B5 7E
**************************************************************************************************************************
TX : 7E A0 19 03 41 D6 10 1C E6 E6 00 C0 01 81 00 07 01 00 5E 5B 00 FF 03 00 4C 96 7E
RX : 7E A8 89 41 03 9C B9 83 E6 E7 00 C4 01 81 00 01 16 02 04 12 00 08 09 06 00 00 01 00 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 0C 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 0B 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 5B 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 0D 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 0E 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 09 07 25 5C 7E
TX : 7E A0 07 03 41 F1 4E 24 7E
RX : 7E A8 89 41 03 9E AB A0 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 01 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 01 08 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 09 08 00 FF 0F 02 12 00 00 02 04 12 00 04 09 06 01 00 01 06 00 FF 0F 02 12 00 00 02 04 12 00 04 09 06 01 00 01 06 00 FF 0F 05 12 00 00 02 04 12 00 04 09 06 01 00 09 06 00 FF 0F 02 12 00 00 02 04 12 00 04 09 06 01 00 09 06 00 FF 8C FE 7E
TX : 7E A0 07 03 41 11 40 C3 7E
RX : 7E A8 89 41 03 90 D5 49 0F 05 12 00 00 02 04 12 00 03 09 06 00 00 5E 5B 0E FF 0F 02 12 00 00 02 04 12 00 01 09 06 00 00 5E 5B 00 FF 0F 02 12 00 00 02 04 12 00 01 09 06 00 00 00 01 00 FF 0F 02 12 00 00 02 04 12 00 01 09 06 00 00 60 02 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 02 08 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 0A 08 00 FF 0F 02 12 00 00 02 04 12 00 46 09 06 00 00 60 03 0A FF 0F 02 93 3D 7E
TX : 7E A0 07 03 41 31 42 E2 7E
RX : 7E A0 1E 41 03 92 09 89 12 00 00 02 04 12 00 47 09 06 00 00 11 00 00 FF 0F 03 12 00 00 52 B5 7E
Thanks
Mohanraj
Hi Mohanraj,
Hi Mohanraj,
What method returns this error?
BR,
Mikko
HiMikko,
HiMikko,
we are not able to go in details. but the return value of com_read is DLMS_ERROR_CODE_INVALID_PARAMETER. further any com_read returns the same error code.
Thanks
Mohanraj
Hi Mikko,
Hi Mikko,
Incase if stack returns DLMS_ERROR_CODE_INVALID_PARAMETER for com_read function how to recover it? please suggest workaround? and why stack should return that error code when data is correct?
Thanks
Mohanraj
Hi,
Hi,
In your trace above you read attribute index #3 twice. Check why this is happening.
BR,
Mikko
Hi Mikko,
Hi Mikko,
for every time we are reading index #3 followed by index #2. is not recommended?
what do you suggest?
read index #3 once for profile generic object after that continuously we can read only index#2?
Thanks
Mohanraj
Hi Mohanraj,
Hi Mohanraj,
You need to read capture objects before you read index #3, but in your trace, you have read index #3 twice and not read index #2 at all. Check your code. I believe that you have made medications for com_read -method.
BR,
Mikko
Hi Mikko,
Hi Mikko,
how to read capture objects before reading index#3 followed by index#2?
I assume that com_read(&con, profile_obj, 3) is reading capture object and com_read(&con, profile_obj, 2) is data
please correct and suggest.
Thanks
Mohanraj
Hi Mohanraj,
Hi Mohanraj,
You are right. I suggest that you check that you haven't modified the source code. I believe that is the problem why you are reading capture objects twice or then your trace above is wrong.
BR,
Mikko
Hi Mikko,
Hi Mikko,
i have not modified the source. it was a mistake that we were referring wrong trace.
Thanks
Mohanraj