pyVCP button to call a python script

06 Mar 2017 16:38 #89095 by AThayer

I would like to put buttons on my VCP that will run a python script. I want to call with a button. Thank you for the help as I'm new to linuxcnc and making custom panels.
06 Mar 2017 19:29 #89101 by andypugh
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.

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.
Time to create page: 0.109 seconds
Powered by Kunena Forum