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
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
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
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