Reading and writing to Parameter Variables?
- Todd Zuercher
-
Topic Author
- Away
- Platinum Member
-
Less
More
- Posts: 4743
- Thank you received: 1454
18 Jun 2026 09:44 #347145
by Todd Zuercher
Reading and writing to Parameter Variables? was created by Todd Zuercher
I would like to set up a GladeVCP tab (in Axis) that displays and can set the values for a range G-code numbered parameter variables, similar to how most industrial control interfaces have. I tried to use AI to write the handler file, but that is failing for me. I used Glade to make the tab screen and that looks good and opens in the tab, it just doesn't do anything yet. When running Linuxcnc from the terminal I'm not seeing any messages that are helping me see what is wrong. Here are the glade and py files I have so far.
Attachments:
Please Log in or Create an account to join the conversation.
- Aciera
-
- Online
- Administrator
-
Less
More
- Posts: 4716
- Thank you received: 2108
18 Jun 2026 12:41 #347147
by Aciera
Replied by Aciera on topic Reading and writing to Parameter Variables?
Are you sure you are actually loading 'variables.py' along with the 'variables.glade' in the ini file entry?
Please Log in or Create an account to join the conversation.
- Aciera
-
- Online
- Administrator
-
Less
More
- Posts: 4716
- Thank you received: 2108
18 Jun 2026 12:48 #347148
by Aciera
Replied by Aciera on topic Reading and writing to Parameter Variables?
This is nonsense as there is no access to the parameter values from the status channel:
You need to either read the relevant lines of the .var file on startup OR issue an MDI command to read each parameter value and find a way to grab the return value. (reading the .var file on startup would be my choice here)
# Set initial value from LinuxCNC parameters
self.s.poll()
spin.set_value(self.s.settings[i])You need to either read the relevant lines of the .var file on startup OR issue an MDI command to read each parameter value and find a way to grab the return value. (reading the .var file on startup would be my choice here)
Please Log in or Create an account to join the conversation.
Moderators: HansU
Time to create page: 0.124 seconds