pyVCP button to call a python script
06 Mar 2017 16:38 #89095
by AThayer
pyVCP button to call a python script was created by AThayer
Hey,
I would like to put buttons on my VCP that will run a python script. I want to call hole_circle.py with a button. Thank you for the help as I'm new to linuxcnc and making custom panels.
I would like to put buttons on my VCP that will run a python script. I want to call hole_circle.py with a button. Thank you for the help as I'm new to linuxcnc and making custom panels.
Please Log in or Create an account to join the conversation.
06 Mar 2017 19:29 #89101
by andypugh
Replied by andypugh on topic pyVCP button to call a python script
You can easily embed code in a GladeVCP panel (in which case you use ordinary Glade buttons, rather than a hal_button).
This would be helpful if you were using GladeVCP.
stackoverflow.com/questions/3781851/run-...ript-passing-in-args
You would need a very minimal Python handler loaded at the same time as the GladeVCP.
However, you are trying to do it with PyVCP, and that is somewhat more kludgy.
The only way that I know to do it with PyVCP is to have the PyVCP pin connect to a halui.mdi-command-NN pin, and then have that MDI_COMMAND call the script as a custom M-code.
This would be helpful if you were using GladeVCP.
stackoverflow.com/questions/3781851/run-...ript-passing-in-args
You would need a very minimal Python handler loaded at the same time as the GladeVCP.
However, you are trying to do it with PyVCP, and that is somewhat more kludgy.
The only way that I know to do it with PyVCP is to have the PyVCP pin connect to a halui.mdi-command-NN pin, and then have that MDI_COMMAND call the script as a custom M-code.
Please Log in or Create an account to join the conversation.
Time to create page: 0.996 seconds