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 1 month 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 1 month 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 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 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 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 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 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 ago

Thank you !

Thank you !

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin