Hi Kurami,
i'm trying to disconnect and reconnect an Hexing meter with Gurux Director sending the obis code 0.0.96.3.10.255 .
The frames sent from Gurux Director are:
Disconnect command
7E A0 1B 03 2F 32 09 7B E6 E6 00 C3 01 C1 00 46 00 00 60 03 0A FF 01 01 0F 00 68 A6 7E
Reconnect command
7E A0 1B 03 2F 32 09 7B E6 E6 00 C3 01 C1 00 46 00 00 60 03 0A FF 02 01 0F 00 A5 83 7E
but the meter doesn't reply
But it works fine if i send
remote disconnect
7E A0 1B 03 25 98 29 8C E6 E6 00 C3 01 81 00 46 00 00 60 03 0A FF 01 01 0F 00 39 C5 7E
meter reply: 7E A0 10 25 03 B8 3F CF E6 E7 00 C7 01 81 00 40 F6 7E
remote reconnect
7E A0 1B 03 25 BA 39 8E E6 E6 00 C3 01 81 00 46 00 00 60 03 0A FF 02 01 0F 00 F4 E0 7E
meter reply: 7E A0 10 25 03 DA 2B 8F E6 E7 00 C7 01 81 00 40 F6 7E
the diference that i can see is from C1 to 81 in the pdu .
Can you explain what are these parameters?
You need to change ServiceClass from Confirmed to unconfirmed. You can find this from the GXDLMSDirector meter settings or changing GXDLMSClient.ServiceClass property.
Hi,
Hi,
You need to change ServiceClass from Confirmed to unconfirmed. You can find this from the GXDLMSDirector meter settings or changing GXDLMSClient.ServiceClass property.
BR,
Mikko
Hi Mikko,
Hi Mikko,
I'm using this function to disconnect the power switch.
void control_ICP (void)
{
int ret;
connection con;
message messages;
gxReplyData reply;
gxDisconnectControl dc;
dlmsVARIANT params;
const unsigned char ln[6] = { 0,0,96,3,10,255 };
con_init(&con, GX_TRACE_LEVEL_ERROR);
//Initialize settings using Logical Name referencing and HDLC.
cl_init(&con.settings, 1, CLIENT_ADDR, 1, DLMS_AUTHENTICATION_LOW, "00000000", DLMS_INTERFACE_TYPE_HDLC);
//Initialize connection.
printf("\n\n\r Initialize meter connection :\n\n");
ret = com_initializeConnection(&con);
if (ret != DLMS_ERROR_CODE_OK) { return ret; }
// "Disconnecting ICP"
printf("\n\n\r Disconnecting ICP :\n\n");
GX_INT8(params);
if ((ret = cosem_init2(BASE(dc), DLMS_OBJECT_TYPE_DISCONNECT_CONTROL, ln)) == 0)
{
mes_init(&messages);
reply_init(&reply);
//Remote disconnect
if ((ret = cl_method(&con.settings, BASE(dc), 1, ¶ms, &messages)) != 0 ||
(ret = com_readDataBlock(&con, &messages, 2)) != 0)
{
printf("Method failed %s\r\n", hlp_getErrorMessage(ret));
}
mes_clear(&messages);
reply_clear(&reply);
icp_closed = false;
}
But the program blocks at
int dlms_getHdlcData(...)
{
::::
data->complete = 1; <<< stops here at dlms.c line 2843
// Find start of HDLC frame.
::::
}
These are the request and reply
5: 7E A0 1B 03 21 32 19 E1 E6 E6 00 C3 01 81 00 46 00 00 60 03 0A FF 01 01 0F 00 39 C5 7E
<ActionRequest>
<ActionRequestNormal>
<!-- Priority: High, ServiceClass: UnConfirmed, ID: 1 -->
<InvokeIdAndPriority Value="81" />
<MethodDescriptor>
<!-- DisconnectControl -->
<ClassId Value="0046" />
<!-- 0.0.96.3.10.255 -->
<InstanceId Value="000060030AFF" />
<MethodId Value="01" />
</MethodDescriptor>
<MethodInvocationParameters>
<Int8 Value="00" />
</MethodInvocationParameters>
</ActionRequestNormal>
</ActionRequest>
6: 7E A0 10 21 03 52 0A E4 E6 E7 00 0E 06 03 02 91 24 7E
<ConfirmedServiceError>
<Service Value="06" />
<ServiceError>
<Service Value="ServiceUnsupported" />
</ServiceError>
</ConfirmedServiceError>
But with the software from the manufacture it works and these are the request and reply
1: 7E A0 1B 03 25 32 79 86 E6 E6 00 C3 01 81 00 46 00 00 60 03 0A FF 01 01 0F 00 39 C5 7E
<ActionRequest>
<ActionRequestNormal>
<!-- Priority: High, ServiceClass: UnConfirmed, ID: 1 -->
<InvokeIdAndPriority Value="81" />
<MethodDescriptor>
<!-- DisconnectControl -->
<ClassId Value="0046" />
<!-- 0.0.96.3.10.255 -->
<InstanceId Value="000060030AFF" />
<MethodId Value="01" />
</MethodDescriptor>
<MethodInvocationParameters>
<Int8 Value="00" />
</MethodInvocationParameters>
</ActionRequestNormal>
</ActionRequest>
2: 7E A0 10 25 03 52 6B 87 E6 E7 00 C7 01 81 00 40 F6 7E
<ActionResponse>
<ActionResponseNormal>
<!-- Priority: High, ServiceClass: UnConfirmed, ID: 1 -->
<InvokeIdAndPriority Value="81" />
<Result Value="Success" />
</ActionResponseNormal>
</ActionResponse>
Do you have any idea of what can be the fault in my program?
Thank you for all!
BR
Dilan
Hi,
Hi,
You need to change CLIENT_ADDR. Not it's 0x10 and that is for None(public) association.
BR,
Mikko