Page 1 of 1
VCP and external program launch
Posted: Wed Jan 15, 2025 5:39 pm
by Gerral
Is it possible to configure a button on the VCP launch an external program?
Thanks in advance.
Re: VCP and external program launch
Posted: Thu Jan 16, 2025 3:02 am
by suntravel
You can run a macro with a VCP button and use M130 in the macro to run a system command.
10.48 M130 – Run System Command
This allows shell commands to be called from a CNC program or MDI. M130 takes one string argument which
contains the system command to execute.
Example:
M130 " mycommand .bat"
will run the batch file mycommand.bat.
Normally, the command will run asynchronously, meaning that the G-code program will not wait for the command to
finish before continuing. However, if an L1 parameter is given, the M130 command will wait until the “mycommand.bat”
finishes execution or an operator abort or fault occurs (such as E-Stop).
If you need to call a command that contains spaces in the path, then you must add escaped quotes around the path.
An escaped quote is a backslash followed by a quote.
Example:
M130 "\C:\ Users \CNC User \ myfile .bat \"
Uwe
Re: VCP and external program launch
Posted: Thu Jan 16, 2025 9:14 am
by ASPeters
Gerral wrote: ↑Wed Jan 15, 2025 5:39 pm
Is it possible to configure a button on the VCP launch an external program?
Thanks in advance.
Yes, in the .xml for the vcp button you'll do
Code: Select all
<vcp_button>
<app>C:\path\to\your\program.exe</app>
</vcp_button>
This is how the plasma profile manager is launched in the plasma software. You can look at .\resources\vcp\Buttons\profile_manger for an example in your cnc12 install (all buttons are included with all software).
Re: VCP and external program launch
Posted: Thu Jan 16, 2025 9:29 am
by Gerral
That works!
Thanks!
Re: VCP and external program launch
Posted: Thu Jan 16, 2025 7:48 pm
by cnckeith
ASPeters wrote: ↑Thu Jan 16, 2025 9:14 am
Gerral wrote: ↑Wed Jan 15, 2025 5:39 pm
Is it possible to configure a button on the VCP launch an external program?
Thanks in advance.
Yes, in the .xml for the vcp button you'll do
Code: Select all
<vcp_button>
<app>C:\path\to\your\program.exe</app>
</vcp_button>
This is how the plasma profile manager is launched in the plasma software. You can look at .\resources\vcp\Buttons\profile_manger for an example in your cnc12 install (all buttons are included with all software).
i added this to the VCP manual along with image as a <background>, reference to color picker and edited the <run> section as well as other minor tweaks to improve the doc. here is the link.
https://www.centroidcnc.com/centroid_di ... manual.pdf refresh your browser to get the latest version of the pdf with today's date.
Re: VCP and external program launch
Posted: Thu Jun 19, 2025 10:28 am
by corbin
What version was <app> added?
I've been doing this to pass parameters to my application:
<vcp_button>
<run>
<line>M130 "C:\CNCM\ToolRackSetup.exe -showToolSetupWindow"</line>
</run>
</vcp_button>
Re: VCP and external program launch
Posted: Thu Jun 19, 2025 10:45 am
by ASPeters
corbin wrote: ↑Thu Jun 19, 2025 10:28 am
What version was <app> added?
I've been doing this to pass parameters to my application:
<vcp_button>
<run>
<line>M130 "C:\CNCM\ToolRackSetup.exe -showToolSetupWindow"</line>
</run>
</vcp_button>
v4.80 for Acorn, v5.00 for other boards