Hi Tweakie
Thanks for your answer.
I forget to tell that this pause is for thread changing and in G code is present M6 command that pause execution of G CODE. but I don't know id spindle stops when GCODE arrives to M6 command used for tool change/thread change in embroidery work (I use a manually operated router in my cnc router)
I will use a stepper motor in two modes, SPINDle and Z axis.(the same config in both)
and create two extra VB screen buttons, that can be different if:
1-Spindle and X and Y stops when a M6 command arrives
First button
1-Swap Axis (Stepper motor change from Spindle mode to Z axis mode)
2-Home Z axis ( Stepper motor will turn until slot disk in shaft activate optoswitch and stops it when needle is in upper position)
3-ResetSwap Axis(Z axis x Spindle)-Stepper motor come back to spindle mode.
4-End.
In this moment machine is totally stopped, and needle is in upper position, then I can manually change thread, and when I finish, should touch second VB screen button for restart.
Second VB Button
1-M3 S500---Spindle start 500RPM.
x and Y axis, will move when optoswitch will be activated by embroidery machine shaft.
Important note
Mach3 is working in Single BLK mode,using a optoswitch for activate succesive Gcode lines and move X and Y axis when needle is going out of fabric. A slot disk will be located in embroidery machine shaft,for optoswitch activation using OEM TRIGGER in INPUTS and System Hotkeys for Cycle START (1000). Then, for each motor revolution will be called one Gcode line containing X and Y movements for pantograph. Spindle motor speed will run as fast as X and Y can move a max distance (i.e.5mm)in 40% of time for a motor revolucion (period when Needle is above fabric). This will be tested soon, when I finish pantograph building, and I can see how speed can be my embroidey machine.
2-If Spindle don't stop when a M6 command arrives, then I should place a macro in M6 position.
this macro will contains similar instructions to first one VBButon related before for needle positionable movements
1-M5--Spindle stops
2-Feed hold--Pause pantograph
3--Swap Axis (Stepper motor change from Spindle mode to Z axis mode)
4-Home Z axis ( Stepper motor will turn until slot disk in shaft activate optoswitch and stops it when needle is in upper position)
5-ResetSwap Axis(Z axis x Spindle)-Stepper motor come back to spindle mode.
6-End.
Then I change thread and in this case I will use only second VB screen button for Spindle start.
Or maybe is better do in second way and use one VB button for spindle start, and posicionament of needle will be in macro substituing a M6 command.
Could be in this way?
Thanks for your answer and sorry my bad english
Rene