Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Disconnect Control

Disconnect Control

By _Aparna_ , 26 June, 2023
Forums
Gurux.DLMS

Hi Mikko

How to read disconnect control and perform remote disconnect and reconnect. I have given in this way. Please let me know if any changes need to be done.

reader = None
reader= GXDLMSReader(settings.client, settings.media, settings.trace, settings.invocationCounter)
reader.initializeConnection()
id = "0.0.96.3.10.255"
disc = GXDLMSDisconnectControl(ln=id)
readobject = reader.read(disc, 4)
print(readobject)
disconnect = disc.remoteDisconnect(settings.client)
print(disconnect)
reconnect = disc.remoteReconnect(settings.client)
print(reconnect)

Thanks
Aparna

Profile picture for user Kurumi

Kurumi

2 years 11 months ago

Hi Aparna, The idea of your…

Hi Aparna,

The idea of your code looks correct. Are you getting any errors from the meter?
Make sure that your authentication level is correct. Usually, it must be High.

BR,
Mikko

_Aparna_

2 years 11 months ago

Hi Mikko, I want to test the…

Hi Mikko,

I want to test the meter relay switch where it should get connected and disconected in a loop. But that it is not getting executed same as GuruxDirector- load limit status.

Now i have changed the code as below. the operation is being performed this way but the following error is being encountered and program getting terminated.

reader= GXDLMSReader(settings.client, settings.media, settings.trace, settings.invocationCounter)
reader.initializeConnection()
disc = GXDLMSDisconnectControl("0.0.96.03.10.255")
readobject = reader.read(disc, 4)
print(readobject)
print(disc.controlMode)
readobject1 = reader.read(disc, 3)
print(readobject1)
readobject2 = reader.read(disc,2)
print(readobject2)
readobject3 = reader.read(disc,1)
print(readobject3)
reply = GXByteBuffer()
reconnect = reader.readDataBlock(disc.remoteReconnect(settings.client),reply)
print(reconnect)
time.sleep(10)
disconnect = reader.readDataBlock(disc.remoteDisconnect(settings.client), reply)
print(disconnect)

the error:
reconnect = reader.readDataBlock(disc.remoteReconnect(settings.client),reply)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\aparna.p\Desktop\DLMS\gurux_dlms\GXDLMSReader.py", line 182, in readDataBlock
self.readDataBlock(it, reply)
File "c:\Users\aparna.p\Desktop\DLMS\gurux_dlms\GXDLMSReader.py", line 186, in readDataBlock
while reply.isMoreData():
^^^^^^^^^^^^^^^^
AttributeError: 'GXByteBuffer' object has no attribute 'isMoreData'

Thanks
Aparna

_Aparna_

2 years 11 months ago

Hi Mikko, This is working…

Hi Mikko,

This is working for me.

reply = GXByteBuffer()
reconnect = reader.readDLMSPacket(disc.remoteReconnect(settings.client), reply)
print(reconnect)
time.sleep(20)
disconnect = reader.readDLMSPacket(disc.remoteDisconnect(settings.client), reply)
print(disconnect)

Thanks
Aparna

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin