Run the threading wizard for a sample for code.
Also;
Some motion controllers work weird / wrong.
Sometimes the wizards work weird/wrong in threading. Its always consistent.
This is a very complex issue - and I am doing/will be doing a complete write-up on how to do *perfect threads* and howto.
It is affected by;
motion controller, mach3 version, imperial/metric, diameter/radius, and negatives/positives in some values in the wizard.
There are complex interactions in m3 and the wizards, and sometimes the problems show up and sometimes not.
The issues may appear for example when doing an inside vs outside thread, and or if the pullout angle is positive/negative (dont remember any more. I looked at this about 2 years back).
Just wanted to mention this, so You have an understanding why your combo may not appear to work vs other people.
I WILL have a working version in Mach4 with:
-With the motion controllers I use (CSMIO IPS, Pokeys) and metric. Other motion controllers as I get some.
-I will also document the imperial version
-Encoder threading or encoder index pulses
-Step/dir spindle (servo spindle or c-axis)