Gurux DLMS communication addressing

1.6k Views Asked by At

I've an existing Actaris Electricity meter system and I've got only few information about it. I have to write a new program to replace the current one that is reading data from the meter. I'm trying to listen into the current communication throught the serial port and I see that the SNRM request is like this: 7E A0 0A 00 22 00 CB 03 93 69 CE 7E

I've detected that the client address is 1, the logical device address is 17 and the meter's physical address is 101.

I'd like to use GURUX GXDLMSClient to read data from the meters, but if I set the parameters like this:

`GXDLMSClient client = new GXDLMSClient();
 client.UseLogicalNameReferencing = true;
 client.InterfaceType = InterfaceType.HDLC;
 client.ClientAddress = 1;
 client.ServerAddress = GXDLMSClient.GetServerAddress(17, 101);
 client.ServerAddressSize = 4;`

I send the SNRM request like this: 7E A0 0A 00 00 22 CB 03 93 55 0E 7E

Why is 22 value of the 4 sized server address is in different position than in the current communication? What is the right way to handle this proble?

HorCsa

1

There are 1 best solutions below

0
On

Never used the Gurux libs but looking @ the sources:

public static int GetServerAddress(int logicalAddress,
                                   int physicalAddreess)
{
    return GetServerAddress(logicalAddress, physicalAddress, 0);
}


public static int GetServerAddress(int logicalAddress,
                                   int physicalAddreess,
                                   int addressSize)
{
/* ... packs it with less bytes as possible */
}

Thus, in your case creates an address of two bytes.

Later you are instructing to pack as a 4 bytes address. So the 2 bytes address that you've previously created is assumed to be the physical address of a four bytes address.

SC