Thanks for the answer, that works perfectly. Once one makes the query, where does it recover the value that the OBI returns ???
ret = com_read(&gn.base, 2);
I have that query configured to give me the voltage. When I print the response from the serial port, the value reaches me perfectly. But I don't know what method of the object has that value saved, to use in the program.
It depends what object type you try to read. If the object type is gxData or gxRegister read value is found from the gn.value parameter. In register there are also scaler and unit parameters.
Hello, I am reading those objects, but all the variables return me zero. I made a modification in the arduino code after this happens and comment on the line that interprets the serial port input. When I comment and redirect the traffic to the console, I see that the packages that arrive to me have the requested data. But when I leave the normal program flow, this answers me:
Hi,
Hi,
It depends what object type you try to read. If the object type is gxData or gxRegister read value is found from the gn.value parameter. In register there are also scaler and unit parameters.
BR,
Mikko
Hello, I am reading those
Hello, I am reading those objects, but all the variables return me zero. I made a modification in the arduino code after this happens and comment on the line that interprets the serial port input. When I comment and redirect the traffic to the console, I see that the packages that arrive to me have the requested data. But when I leave the normal program flow, this answers me:
<HDLC len="17" >
<TargetAddress Value="1" />
<SourceAddress Value="16401" />
<!--AARE frame.-->
<FrameType Value="30" />
<PDU>
<Data="0102" />
</PDU>
</HDLC>
***********************************************************************************
Will it be that in this part of the Client.ino code you are not saving the data in the objects? (function int readDLMSPacket)
do
{
if (com_readSerialPort(0x7E) != 0)
{
return DLMS_ERROR_CODE_SEND_FAILED;
}
ret = cl_getData(&meterSettings, &frameData, reply);
if (ret != 0 && ret != DLMS_ERROR_CODE_FALSE)
{
break;
}
} while (reply->complete == 0);
greetings and thanks for the prompt response!
Hi,
Hi,
You should check to ret-value to make sure that read has succeeded.
From the AARE message that you post, it seems that your connection has failed. Check the password.
BR,
Mikko