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. Node
  3. 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 2 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_

3 years 2 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_

3 years 2 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

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin