HIYA J, There are many ways to do what I think you want. It depends on exacly what you need. MACH3 is VERY powerful in some respects.Here is an example of a simple 4 button function Gcode program that for the most part takes VB out of the equation for motion control yet allows you to use the VB functions to selct moduals to run in any order you choose.
Sample Gcode Program with all moduals included in the Base code. Note that each modual has a SUBProgram place marker (o1,o2,o3,o4)
G90 G54 G80 (etc,etc)
G0X0Y0Z0
/M2
o1
G1 X1 Y0 F50
X1y1
X0y1
X0y0
/M2
o2
G1 X5 Y0 F50
X5y5
X0y5
X0y0
/M2
o3
G1 X10 Y0 F50
X10y10
X0y10
X0y0
/M2
o4
M30
VB Button scripts for buttons, one for each screen button
Code"m98 P1 L1"
DoButton(0)
Code"m98 P2 L1"
DoButton(0)
Code"m98 P3 L1"
DoButton(0)
Code"m98 P4 L1"
DoButton(0)
Load the master Program. IF you want Mach3 to check the code then press the block delete button and mach will preveiw all moduals and display what it can on the screen. To run turn OFF the block delete button.
Next select what modual you want to run and press the correct button. It will MOVE to that modual and run the code . At the M2 line it will stop.
Next select the next modual you want to run and press the button . It will move to that modual and run the code. At the M2 line it will stop.
To end press the button for selection 4 and it will run the M30 ,end the program and rewind back to the top.
IF you want to run the program end to end and in that order then turn ON the block delete and Mach will run it start to finish.
There are Many OTHER ways to do this as well. You could have a SINGLE intelligent button that ASKS you what modual you want to run next AND even be able to input #variable values into play.
Hope that helps, (;-) TP