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.
Hey!
I am able to read registers and meter responds as required. But after 1 loop i am getting a service error.
This is the code i used in arduino :
gxRegister voltageL1;
void loop() {
for(int i=0; i<2; i++)
{
int ret;
//Initialize connection.
ret = com_initializeConnection();
ret = com_read(&voltageL1.base, 2);
ret = com_read(&voltageL1.base, 3);
Serial.println("\n L1 Voltage = ");
Serial.print((int)voltageL1.value.llVal * pow(10, (int)voltageL1.scaler)); // Voltage L1
com_close();
}
while(1)
{ ; }
}
Response form the meter as follows :
1: 7E A0 20 41 03 73 3E 9D 81 80 14 05 02 02 00 06 02 02 00 07 04 00 00 00 01 08 04 00 00 00 01 6F EF 7E
<HDLC len="1F" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<!-- UA frame. -->
<FrameType Value="73" />
<PDU>
<Ua>
<MaxInfoTX Value="512" />
<MaxInfoRX Value="512" />
<WindowSizeTX Value="1" />
<WindowSizeRX Value="1" />
</Ua>
</PDU>
</HDLC>
2: 7E A0 37 41 03 30 21 79 E6 E7 00 61 29 A1 7A 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 10 1C 02 00 00 07 9C DF 7E 7E A0 15 41 03 52 10 8F E6 E7 00 C4 01 81 00 06 01 5C 02 0E 4E 3F 7E
<HDLC len="4E" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<FrameType Value="52" />
<PDU>
<GetResponse>
<GetResponseNormal>
<InvokeIdAndPriority Value="81" />
<Result>
<Data>
<UInt32 Value="015C020E" />
</Data>
</Result>
</GetResponseNormal>
</GetResponse>
</PDU>
</HDLC>
3: 7E A0 16 41 03 74 E9 EE E6 E7 00 C4 01 81 00 02 02 0F FB 16 23 64 FE 7E
<HDLC len="15" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<FrameType Value="74" />
<PDU>
<GetResponse>
<GetResponseNormal>
<InvokeIdAndPriority Value="81" />
<Result>
<Data>
<Structure Qty="02" >
<Int8 Value="FFFFFFFFFFFFFFFB" />
<Enum Value="23" />
</Structure>
</Data>
</Result>
</GetResponseNormal>
</GetResponse>
</PDU>
</HDLC>
4: 7E A0 20 41 03 73 3E 9D 81 80 14 05 02 02 00 06 02 02 00 07 04 00 00 00 01 08 04 00 00 00 01 6F EF 7E
<HDLC len="1F" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<!-- UA frame. -->
<FrameType Value="73" />
<PDU>
<Ua>
<MaxInfoTX Value="512" />
<MaxInfoRX Value="512" />
<WindowSizeTX Value="1" />
<WindowSizeRX Value="1" />
</Ua>
</PDU>
</HDLC>
5: 7E A0 20 41 03 73 3E 9D 81 80 14 05 02 02 00 06 02 02 00 07 04 00 00 00 01 08 04 00 00 00 01 6F EF 7E
<HDLC len="1F" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<!-- UA frame. -->
<FrameType Value="73" />
<PDU>
<Ua>
<MaxInfoTX Value="512" />
<MaxInfoRX Value="512" />
<WindowSizeTX Value="1" />
<WindowSizeRX Value="1" />
</Ua>
</PDU>
</HDLC>
6: 7E A0 37 41 03 30 21 79 E6 E7 00 61 29 A1 09 06 07 60 7A 85 74 05 08 01 01 A2 03 02 01 01 A3 05 A1 03 02 01 0D BE 10 04 0E 08 00 06 5F 1F 04 00 00 10 1C 02 00 00 07 8F 66 7E 7E A0 10 41 03 52 47 E1 E6 E7 00 0E 01 03 02 94 A8 7E
<HDLC len="49" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<FrameType Value="52" />
<PDU>
<ConfirmedServiceError>
<Service Value="01" />
<ServiceError>
<Service Value="ServiceUnsupported" />
</ServiceError>
</ConfirmedServiceError>
</PDU>
</HDLC>
7: 7E A0 10 41 03 74 73 A5 E6 E7 00 0E 01 03 02 94 A8 7E
<HDLC len="F" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<FrameType Value="74" />
<PDU>
<ConfirmedServiceError>
<Service Value="01" />
<ServiceError>
<Service Value="ServiceUnsupported" />
</ServiceError>
</ConfirmedServiceError>
</PDU>
</HDLC>
8: 7E A0 20 41 03 73 3E 9D 81 80 14 05 02 02 00 06 02 02 00 07 04 00 00 00 01 08 04 00 00 00 01 6F EF 7E
<HDLC len="1F" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<!-- UA frame. -->
<FrameType Value="73" />
<PDU>
<Ua>
<MaxInfoTX Value="512" />
<MaxInfoRX Value="512" />
<WindowSizeTX Value="1" />
<WindowSizeRX Value="1" />
</Ua>
</PDU>
</HDLC>
Why does this error occure and how can i solve it.
Hi,
Hi,
There are no client requests on the trace, but it seems that you are not calling AARQRequest to establish the connection. Are you established a connection before the loop?
BR,
Mikko
BR,
Mikko