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. Forums
  3. Execute Script From Script Table In Python

Execute script from script table in Python

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By Vitaol , 14 June, 2022
Forums
Gurux.DLMS

Hi,
I'm trying to execute a script from a script table using Python, the code I use is the following:

scriptTable = GXDLMSScriptTable("1.1.1.128.0.255")
script = GXDLMSScript()
script.id = 1
scriptTable.execute(client, script)

And I get the error:
AttributeError: 'GXDLMSScript' object has no attribute 'getId'

As far as I can see in the class definition it's true that there is no getId method:

https://github.com/Gurux/Gurux.DLMS.Python/blob/master/Gurux.DLMS.pytho…

Maybe I'm doing something else wrong?

Profile picture for user Kurumi

Kurumi

4 years 1 month ago

Hi,

Hi,

You are right. I created an issue from this:
https://www.gurux.fi/node/19972

The new version is released today as this is tested.

BR,
Mikko

Profile picture for user Kurumi

Kurumi

4 years 1 month ago

Hi,

Hi,

Before the release you can use it like this:

scriptTable = GXDLMSScriptTable("1.1.1.128.0.255")
script = GXDLMSScript()
script.id = 1
scriptTable.execute(client, script.id)

BR,
Mikko

Vitaol

4 years 1 month ago

I tried and I can't get it to

I tried and I can't get it to work, I also tried the client.method() and didn't work either.
I'm thinking that maybe I have not configured the client correctly.
The DLMS command line is:
-h 192.168.1.54 -p 10004 -c 17 -a Low -P Password -w 1 -f 128 -t Verbose
In the code I configured as follow:
client = GXDLMSSecureClient(forAuthentication=Authentication.LOW)
client.useLogicalNameReferencing = True
client.clientAddress = 0x11
client.serverAddress =GXDLMSClient.getServerAddress(0,1)
client.password = 'Password '
client.interfaceType = InterfaceType.HDLC
client.ciphering.security = Security.NONE

It seems to be working because I can read and write data and read registers, but the script execution don't work and don't gives me any trace either so I'm a bit lost. Do you have any idea?

BR

Vitaol

4 years 1 month ago

Hi,

Hi,
Reading the dlms package after the execute seems to fix it.
I'll let the code here in case someone have the same doubt.
I use the reader class from the client example.
scriptTable = GXDLMSScriptTable("1.1.1.128.0.255")
script = GXDLMSScript()
script.id = 1
data = scriptTable.execute(self.client, script.id)
reader.readDLMSPacket(data)

Profile picture for user Kurumi

Kurumi

4 years 1 month ago

Hi,

Hi,

Yes, if you don't call readDLMSPacket the generated frame is not sent for the meter.
I'm glad that it's working now.

BR,
Mikko

shgandhi

3 years 7 months ago

hi mikko ,

hi mikko ,

how this implemented in c code.
and i dont know the command line parameter for this script id.

My CLI parameters are:-

-h 2401:4900:4022:f9e4::2 -p 9083 -i HDLC -c 1 -a HighGmac -C AuthenticationEncryption -T 5753453030303031 -A AE90F90883AC70AF5BCE9D8060EE22F0 -B 22C8DA0AA7BBE7918F57296C4BE9FA23 -o Output.txt -v 0.0.43.1.0.255 -g 0.0.10.0.1.255:2

Profile picture for user Kurumi

Kurumi

3 years 7 months ago

Hi,

Hi,

You can use those command line arguments with the ANSI C client example.

The client example only reads the data from the meter and you need to expand the client example to execute the script table as you wish.

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

  • 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

Who's new

  • cWYHszETmudslY…
  • Aij
  • vondamc1
  • JosephNok
  • IUJbutxeSTSNcNRN
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin