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

3 years 12 months 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

3 years 12 months 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

3 years 12 months 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

3 years 12 months 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

3 years 12 months 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 6 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 6 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

  • 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

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin