Thanks for all of great topics and answers on VB and control tactics.
My situation is close to the question posed in
http://www.machsupport.com/forum/index.php/topic,3879.0.html .
I'm building a machine to drill a particular bolt pattern, repeatedly. Mach3 R3.042.020, G540 controls.
My X and Y axes are steppers and I'm using a pneumatic cylinder to drive the drill (Z) into the material.
I have a "home/retracted" position limit switch for the Z and a "hole depth" input limit switch for the bottom of the Z stroke.
My question is how to control it. I read through the use of 2.5D to control the solenoid valve for the pneumatics. I would like to use the two inputs I have to know when it is safe to move the drilling head to the next location. I don't think I can depend on the G4 Px to pause to wait for the drill to retract.
I have limited VB experience but it would seem that writing an Mcode macro is probably the "right" way to get this operation automated.
If you have a suggestion as to how to best approach this, I would appreciate it. Thank you.
Bill