I am using GURUX.DLMS.Client.Example.python. I am using python3.7 and installed all dependencies listed in requirements.txt. I first read the Inesh make meter from DLMS director with low authentication and it worked fine. I also checked it with Renesas utility and it also worked fine.
I ran it with the command
python main.py -S COM6 -t Verbose -c 32 -s 1 -d India -C None -a Low -P genesis
This gives a huge amount of information.
I actually need only Active Energy , Reactive Energy and Apparent Energy.
Could you please guide on how to get these without going through the entire sequence.
Each DLMS meter is different and for this reason all the objects are read from the meter. You need to check what is Logical name of the object that you want to read and then find readAll and remove everything after self.initializeConnection().
Then you can read example register object like this:
it = GXDLMSRegister("LOGICAL NAME")
//Read scaler and unit.
self.read(it, 3)
//Read value.
self.read(it, 2)
You can use Renesas or GXDLMSDirector to read the data and find out object types and correct logical names.
As advised by you I changed the code to read Frequency. I checked the logical name from GXDLMSDirector. I am attachng the screen shot of what I got from the meter.
Could you please guide me if this is correct and how to get the Frequency value and unit?
Regards
Ajit
def readAll(self, outputFile):
try:
read = False
self.initializeConnection()
it = GXDLMSRegister("1.0.14.7.0.255")
#Read scaler and unit.
self.read(it, 3)
#Read value.
self.read(it, 2)
# if outputFile and os.path.exists(outputFile):
# try:
# c = GXDLMSObjectCollection.load(outputFile)
# self.client.objects.extend(c)
# if self.client.objects:
# read = True
# except Exception:
# read = False
# if not read:
# self.getAssociationView()
# self.readScalerAndUnits()
# self.getProfileGenericColumns()
# self.getReadOut()
# self.getProfileGenerics()
# if outputFile:
# self.client.objects.save(outputFile)
except (KeyboardInterrupt, SystemExit):
#Don't send anything if user is closing the app.
self.media = None
raise
finally:
self.close()
Only one thing. Disconnect Request executes successfully but the program does not terminate. One has to force terminate it. What is the best way to terminate the program?
The program should close automatically. Are you receiving reply from the meter for the disconnect request? I believe that app is waiting for a reply from the meter. Can you check this?
Dear Sir,
Yes I am receiving the reply from Disconnect Request.
I debugged it to find that the function self.media.close() is hanging. So I just added a time.sleep(2) before it and it worked well.
Thank you so much for your time and help.
Hi Ajit,
Hi Ajit,
Each DLMS meter is different and for this reason all the objects are read from the meter. You need to check what is Logical name of the object that you want to read and then find readAll and remove everything after self.initializeConnection().
Then you can read example register object like this:
it = GXDLMSRegister("LOGICAL NAME")
//Read scaler and unit.
self.read(it, 3)
//Read value.
self.read(it, 2)
You can use Renesas or GXDLMSDirector to read the data and find out object types and correct logical names.
BR,
Mikko
Thank You Sir,
Thank You Sir,
I will try it out.
Regards
Ajit
Dear Sir
Dear Sir
As advised by you I changed the code to read Frequency. I checked the logical name from GXDLMSDirector. I am attachng the screen shot of what I got from the meter.
Could you please guide me if this is correct and how to get the Frequency value and unit?
Regards
Ajit
def readAll(self, outputFile):
try:
read = False
self.initializeConnection()
it = GXDLMSRegister("1.0.14.7.0.255")
#Read scaler and unit.
self.read(it, 3)
#Read value.
self.read(it, 2)
# if outputFile and os.path.exists(outputFile):
# try:
# c = GXDLMSObjectCollection.load(outputFile)
# self.client.objects.extend(c)
# if self.client.objects:
# read = True
# except Exception:
# read = False
# if not read:
# self.getAssociationView()
# self.readScalerAndUnits()
# self.getProfileGenericColumns()
# self.getReadOut()
# self.getProfileGenerics()
# if outputFile:
# self.client.objects.save(outputFile)
except (KeyboardInterrupt, SystemExit):
#Don't send anything if user is closing the app.
self.media = None
raise
finally:
self.close()
Hi,
Hi,
Please, don't add pics like this. They are compressed and others can't read them.
You can get the value like this from the register object:
print(it.value)
BR,
Mikko
Dear Sir
Dear Sir
Very Sorry for the image upload.
Thanks a lot for your time and response.
It worked well.
Best Regards
Ajit
Only one thing. Disconnect
Only one thing. Disconnect Request executes successfully but the program does not terminate. One has to force terminate it. What is the best way to terminate the program?
Hi,
Hi,
The program should close automatically. Are you receiving reply from the meter for the disconnect request? I believe that app is waiting for a reply from the meter. Can you check this?
BR,
Mikko
Dear Sir,
Dear Sir,
Yes I am receiving the reply from Disconnect Request.
I debugged it to find that the function self.media.close() is hanging. So I just added a time.sleep(2) before it and it worked well.
Thank you so much for your time and help.
Regards
Ajit