My EMH LZQJ-CX is connected via a serial port server (Moxa). The serial port server operating mode is TCP Server. GXDLMDirector connects to that meter without a problem. I copied command line parameters from GXDLMDirector and tried to use them as parameters for Gurux.DLMS.Client.Example.Net. Unfortunately, this time the meter did not respond to the SNRM request. I have compared SNRM frames sent by GXDLMDirector and Gurux.DLMS.Client.Example.Net, and they are different. I wonder why.
Here are the frames sent by both programs:
Meter EMH LZQJ-XC
GXDLMDirector
Command line parameters: -h 192.168.0.38 -p 4001 -r sn -n 6229136 -t Verbose
08:19:54 Send SNRM request.
TX: 7E A0 0A 00 02 92 61 21 93 6F 15 7E
08:19:54 08:19:54.946 Sent 7E A0 0A 00 02 92 61 21 93 6F 15 7E
08:19:55 08:19:55.046 Received 7E A0 21 21 00 02 92 61 73 5A BB 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
Gurux.DLMS.Client.Example.Net
Command line parameters: -h 192.168.0.38 -p 4001 -r sn -n 6229136 -t Verbose
Standard: DLMS
Send SNRM request.7E A0 0A 00 02 9E 31 21 93 B8 01 7E
TX: 08:25:06 7E A0 0A 00 02 9E 31 21 93 B8 01 7E
TX: 08:25:11 7E A0 0A 00 02 9E 31 21 93 B8 01 7E
TX: 08:25:16 7E A0 0A 00 02 9E 31 21 93 B8 01 7E
Disconnecting from the meter.
Failed to receive reply from the device in given time.
Hi,
Hi,
EMH is not using DLMS standard way to count the serial number. You need to modify the source code.
Change this line:
settings.client.ServerAddress = GXDLMSClient.GetServerAddressFromSerialNumber(int.Parse(it.Value), 1);
to this:
settings.client.ServerAddress = GXDLMSClient.GetServerAddressFromSerialNumber(int.Parse(it.Value), 1, "SN%10000+256");
BR,
Mikko
Hi.
Hi.
Thanks, a lot. It works.
BR,
Yaro