I am able to read meter, successfully able to read the data but since I am not closing the connection after each read, data I am receiving every-time is same.
I have to reset my controller to read the latest value.
And it is working perfectly but as per my application requirement, I cannot reset it everytime.
I tried to get it from DLMSDirector:
I got the thread:
7E A0 07 03 41 53 56 A2 7E
When I am sending this to meter via serial port, it is not disconnecting and I am getting same repeated meter values when I read the meter again.
Please suggest me a connection release and disconnect hex thread so that I can close the connection and then again make connection to read the latest value.
Basically I want to know the hex code need to send to release and disconnect connection with meter.
You don't need to close the connection to re-read the data. The reason is somewhere else.
Because you didn't add the meter reply, I don't know is meter sending an error or acknowledge message.
Your disconnect message is correct.
I have to say that there is a sequence counter for each message. You can read simple data sending hex data, but that will cause problems if you want to read complex data. For example historical data.
Sorry to say, but that is not so easy. There is a HDLC sequence number that is increased for each frame. There is also a checksum in each frame.
Because you want to read profile generic object this comes complicated. You need to check if all data is received and if not you need to send block ACK or HDLC framing ACK.
All this means that you can't just send hard-coded hex strings. You need to really understand HDLC framing and DLMS.
I really propose that you use Gurux Open Source libraries.
Hi,
Hi,
You don't need to close the connection to re-read the data. The reason is somewhere else.
Because you didn't add the meter reply, I don't know is meter sending an error or acknowledge message.
Your disconnect message is correct.
I have to say that there is a sequence counter for each message. You can read simple data sending hex data, but that will cause problems if you want to read complex data. For example historical data.
BR,
Mikko
Ok means we need to send back
Ok means we need to send back next hex code string by adding meter reply in it.
Can you give me one small example so that I can get the idea of how to add the reply in response string.
Hello Mikko,
Hello Mikko,
char snmq[]={0x7E,0xA0,0x20,0x03,0x41,0x93,0x28,0xBC,0x81,0x80,0x14,0x05,0x02,0x02,0x00,0x06,0x02,0x02,0x00,0x07,0x04,0x00,0x00,0x00,0x01,0x08,0x04,0x00,0x00,0x00,0x01,0x6F,0xEF,0x7E};
char aarq[]={0x7E,0xA0,0x48,0x03,0x41,0x10,0x87,0x76,0xE6,0xE6,0x00,0x60,0x3A,0x80,0x02,0x02,0x84,0xA1,0x09,0x06,0x07,0x60,0x85,0x74,0x05,0x08,0x01,0x01,0x8A,0x02,0x07,0x80,0x8B,0x07,0x60,0x85,0x74,0x05,0x08,0x02,0x01,0xAC,0x0A,0x80,0x08,0x41,0x42,0x43,0x44,0x30,0x30,0x30,0x31,0xBE,0x10,0x04,0x0E,0x01,0x00,0x00,0x00,0x06,0x5F,0x1F,0x04,0x00,0x00,0x18,0x19,0xFF,0xFF,0xEB,0xAB,0x7E};
char td[]={0x7E,0xA0,0x19,0x03,0x41,0x32,0x3A,0xBD,0xE6,0xE6,0x00,0xC0,0x01,0x81,0x00,0x08,0x00,0x00,0x01,0x00,0x00,0xFF,0x02,0x00,0x65,0xD7,0x7E};
char prfG[] = {0x7E,0xA0,0x4C,0x03,0x41,0x54,0x4B,0x00,0xE6,0xE6,0x00,0xC0,0x01,0xC1,0x00,0x07,0x01,0x00,0x5E,0x5B,0x00,0xFF,0x02,0x01,0x01,0x02,0x04,0x02,0x04,0x12,0x00,0x08,0x09,0x06,0x00,0x00,0x01,0x00,0x00,0xFF,0x0F,0x02,0x12,0x00,0x00,0x09,0x0C,0x07,0xE6,0x08,0x10,0xFF,0x00,0x00,0x00,0xFF,0xFE,0xB6,0x00,0x09,0x0C,0x07,0xE6,0x08,0x11,0xFF,0x00,0x00,0x00,0xFF,0xFE,0xB6,0x00,0x01,0x00,0x1A,0xEC,0x7E};
i am sending above hex in sequence and bale to receive data correctly but only once,
updated data i am receiving only by reset the controller.
what should be next command to read the updated data.
or it will be good if you can give me idea about how to add meter reply so that i can get updated data from meter.
thanks
Hi,
Hi,
Sorry to say, but that is not so easy. There is a HDLC sequence number that is increased for each frame. There is also a checksum in each frame.
Because you want to read profile generic object this comes complicated. You need to check if all data is received and if not you need to send block ACK or HDLC framing ACK.
All this means that you can't just send hard-coded hex strings. You need to really understand HDLC framing and DLMS.
I really propose that you use Gurux Open Source libraries.
BR,
Mikko