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. Use Gurux.DLMS.Simulator.Net and Gurux.DLMS.Client.Example.python

use Gurux.DLMS.Simulator.Net and Gurux.DLMS.Client.Example.python

By Ford_YE , 12 September, 2023
Forums
Gurux.DLMS

I have questions about DLMS, I use the Gurux.DLMS.Net simulator to simulate the smart meter (I use the xml in the github : crystal.xml). And how to get the simulator meter data using Gurux.DLMS.Client.Example.python code?

The steps I have done as below:

I clone the Gurux.DLMS.Net from github and run the simulator as the command:

> Gurux.DLMS.Simulator.Net.exe -p 1000 -x crystal.xml -t Verbose -N 1
Is this command simulate a meter from crystal.xml?

and it print the content as below:

DLMS HDLC Logical Name simulator start in ports 1000-1000.
Waiting 1.00:00:00 before next execution.
Server address: 1
Associations:
++++++++++++++++++++++++++++
Client address: 16 Without authentication.
Conformance:
Get
MaxReceivePduSize: 832 MaxSendPduSize: 65535

And I clone the Gurux.DLMS.Python. And use the command as below

> cd Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python
> python main.py -h localhost -p 1000
Is this command connect to the simulated meter we made above using dotnet ?

gurux_dlms version: 1.0.145
gurux_net version: 1.0.19
gurux_serial version: 1.0.20
Authentication: Authentication.NONE
ClientAddress: 0x10
ServerAddress: 0x1
Standard: Standard.DLMS
-------- Reading 15 0.0.40.0.0.255 Ch. 0 Current association
Index: 1 Value: 0.0.40.0.0.255
Index: 2 Value: 0.0.40.0.0.255 Ch. 0 Current association, 0.0.40.0.1.255 Ch. 0 Association #1
Index: 3 Value: 16, 1
Index: 4 Value: 96 133 116 5 8 1 1
Index: 5 Value: Conformance.GET 832 65535 6 0
Index: 6 Value: 96 133 116 5 8 2 0
Attribute7 is not readable.
Index: 8 Value: 2
Attribute9 is not readable.
-------- Reading 15 0.0.40.0.1.255 Ch. 0 Association #1
Index: 1 Value: 0.0.40.0.0.255
Index: 2 Value: 0.0.40.0.0.255 Ch. 0 Current association, 0.0.40.0.1.255
Index: 3 Value: 16, 1
Index: 4 Value: 96 133 116 5 8 1 1
Index: 5 Value: Conformance.GET 832 65535 6 0
Index: 6 Value: 96 133 116 5 8 2 0
Attribute7 is not readable.
Index: 8 Value: 2
Attribute9 is not readable.
DisconnectRequest
Ended. Press any key to continue.

How can I get specific content or value using obis code in this project(Gurux.DLMS.Client.Example.python main.py)?

I'm not so familiar with this protocol(Still study). Can you bring some example code demo how to use the functionality about "Get". And the meter data from the simulator above.(crystal.xml)

Thank you very much.

Profile picture for user Kurumi

Kurumi

2 years 10 months ago

Hi, You can use the same…

Hi,

You can use the same command line arguments with Python. If you know what you want to read, you can also add objects manually. Like this:

obj = GXDLMSRegister("Logical name or your object")
#Read scaler and unit
self.read(obj, 3)
#Read value.
self.read(obj, 2)

BR,
Mikko

  • 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

  • gurux_dlms.GXDateTime.GXDateTime object Error in Python
  • T_APPL_DATA_LN_N1 subtest 3 fails on an LN-only server regardless of the response to a non-existing-object GET
  • Version mismatch between Gurux.DLMS 9.x and Gurux.Common/Gurux.Serial 8.x
  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin