VCP and external program launch

Make your own CNC Control Apps

Moderator: cnckeith

Post Reply
Gerral
Posts: 28
Joined: Fri Nov 22, 2024 4:25 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: B4107B77A373-0905248481
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

VCP and external program launch

Post by Gerral »

Is it possible to configure a button on the VCP launch an external program?

Thanks in advance.


suntravel
Posts: 3117
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 6433DB0446C1-08115074
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany

Re: VCP and external program launch

Post 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


ASPeters
Posts: 32
Joined: Thu Feb 10, 2022 5:55 pm
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: VCP and external program launch

Post 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).


Gerral
Posts: 28
Joined: Fri Nov 22, 2024 4:25 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: B4107B77A373-0905248481
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: VCP and external program launch

Post by Gerral »

That works!
Thanks!


cnckeith
Posts: 8486
Joined: Wed Mar 03, 2010 4:23 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Contact:

Re: VCP and external program launch

Post 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.
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html


Post Reply