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. How To Read Specific OBIS Codes In 48 Association Without GetAssociationView() ?

How to Read Specific OBIS Codes in 48 Association without getAssociationView() ?

By Ali_nk , 17 May, 2024
Forums
Gurux.DLMS

Hi,

I want to read only these two OBIS codes in the 48 association:

This is my input:

sampleclient.main([
'main.py',
'-S', self.S,
'-c', '48',
'-a', 'High',
'-P', self.HLS,
'-C', 'AuthenticationEncryption',
'-T', '54333435',
'-A', self.A,
'-B', self.B,
'-D', self.HLSHX,
'-g', '1.0.0.2.0.255:2; 0.0.96.1.0.255:2'
])

Currently, it takes 20 to 24 seconds to execute getAssociationView(). How can I read the required OBIS codes directly without using getAssociationView()?

my code

reader = GXDLMSReader(settings.client, settings.media, settings.trace, settings.invocationCounter)
settings.media.open()
if settings.readObjects:
read = False

try:
reader.initializeConnection()
except Exception as ex:
msgbox.showwarning("Error", str(ex))

if reader:
reader.close()
finally:
pass

if settings.outputFile and os.path.exists(settings.outputFile):
try:
c = GXDLMSObjectCollection.load(settings.outputFile)
settings.client.objects.extend(c)
if settings.client.objects:
read = True
except Exception:
read = False
if not read:
reader.getAssociationView()
for k, v in settings.readObjects:
obj = settings.client.objects.findByLN(ObjectType.NONE, k)
if obj is None:
raise Exception("Unknown logical name:" + k)
if k == "1.0.0.2.0.255" :
val = reader.read(obj, v)
print_to_log("firmware :",val)
if k == "0.0.96.1.0.255":
val = reader.read(obj, v)
print_to_log("Serial No.:",val)
RTC = GXDLMSClock("0.0.1.0.0.255")
rtc_val = reader.read(RTC, 2)
rtc_str = str(rtc_val)

rtc forcing codes

Profile picture for user Kurumi

Kurumi

2 years 2 months ago

Hi, You can save the…

Hi,

You can save the association using -o argument, or remove the association reading and add COSEM object manually as you have already done.

RTC = GXDLMSClock("0.0.1.0.0.255")
rtc_val = reader.read(RTC, 2)
rtc_str = str(rtc_val)

Ali_nk

2 years 2 months ago

Hi, Thanks for the reply. I…

Hi,

Thanks for the reply. I used the -o argument, and it is working fine.

How can I use COSEM objects to read other OBIS codes like voltage, billing count, and serial number?

Profile picture for user Kurumi

Kurumi

2 years 2 months ago

Hi, You need to check the…

Hi,

You need to check the object type and OBIS code e.g. with GXDLMSDirector.
When you know that you can add those objects to the code or add logical name command line arguments.

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