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. Execute Method of Unknown Objects In Python

Execute method of unknown objects in Python

By tarek89 , 12 May, 2023
Forums
Gurux.DLMS

Hi,

I'm want to execute a method of an unkonwn object using Python.
In my exemple, i have :

item: an object cosem that generate automaticaly, so i dont have this type.
index: index of method is known

how i can execute the method with index for any item ?

Profile picture for user Kurumi

Kurumi

3 years 2 months ago

Hi, It's not possible to…

Hi,

It's not possible to execute or read/write for the unknown object. You always need to know the object type. All objects should be in the association view.

BR,
Mikko

tarek89

3 years 2 months ago

Thanks, The object is known…

Thanks,

The object is known from meter and it is present in association view, but for the user it is unknown, so i want to automaticaly execute the method related to a an index and obis code entered by the user.

tarek89

3 years 2 months ago

More explanation: in my case…

More explanation:
in my case, i have a method that return object instance.
for exemple:
* method name : create_item()
* input: obis_code, method_index, data
==> item = create_item(obis_code, method_index, data)
if i want to execute the method 1 of object with obis_code '1.2.1.6.1.255', item will be 'GXDLMSExtendedRegister' instance, so item.reset(client) will be executed.

how i can do that?

tarek89

3 years 2 months ago

Other question, For…

Other question,

For attributs , we have a method called 'getDataType' to return the dataType of attributs.
But how to get the dataType of method?

Profile picture for user Kurumi

Kurumi

3 years 2 months ago

Hi, You need to find the…

Hi,

You need to find the object from the assciation view and use that object type.

Methods are more complex and you need to check what method you want to execute and give the correct parameters.

What you need to do is check what is the object type and then call wanted method with correct parameters.

With method the data types can be quite complex. For that reason it's not possible to return data type for the method.

BR,
Mikko

tarek89

3 years 2 months ago

Hello, That means we cannot…

Hello,

That means we cannot get the data Type of methods?

Profile picture for user Kurumi

Kurumi

3 years 2 months ago

Hi, Yes, you can't get the…

Hi,

Yes, you can't get the data type for the methods. Simple methods use only integer values, but with complex methdos, you need to write different kinds of arrays or structures.

BR,
Mikko

tarek89

3 years 2 months ago

Thank you !

Thank you !

  • 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

  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
  • DLMS server - serving multiple similar datasets gathered from multiple meters across distinct logical addresses
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin