I have a problem with reconnecting to the meter after communication error.
I'm using the code from the example with GXDLMSReader to connect to Landis Gyr ZMQ meter. I can open the connection, read data and then close - then every 20 seconds repeat - everything works fine.
The connection is via RS232 but with MOXA NPort converter in Real COM mode.
Sometimes there are some problems with the connection and the data read fails. When I want to reconnect after the error the connection is rejected and I have to wait for a few (about 5) minutes and then another connection is allowed.
Is there a way to overcome this ? Is there a way reconnect immediatelly after the communication error without waiting this 5 minutes ?
You should call DIsconnect when you close the connection. If a connection fails, you can call DIsconnect and try to connect again.
This is normal behavior if Disconnect is not called properly. There is an inactivity timeout that defines how long meter expects data from the client before it closes the connection. This might cause problems if the connection is not closed properly.
This inactivity timeout is defined on IEC HDLC setup object. You can try to decrease it.
Reconnecting after communication error - Gurux.NET
Hi,
You should call DIsconnect when you close the connection. If a connection fails, you can call DIsconnect and try to connect again.
This is normal behavior if Disconnect is not called properly. There is an inactivity timeout that defines how long meter expects data from the client before it closes the connection. This might cause problems if the connection is not closed properly.
This inactivity timeout is defined on IEC HDLC setup object. You can try to decrease it.
BR,
Mikko
Thank you.
Thank you.
I will try to do disconnect before connect when the communication error occurs.
I will also check the timeout setting.