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

3 years 1 month 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_

3 years 1 month 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_

3 years 1 month 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

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
  • DLMS server - serving multiple similar datasets gathered from multiple meters across distinct logical addresses
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin