4902
« on: November 03, 2011, 12:51:07 PM »
It failed on the Gcode file call from your file. The problem is a Sync problem with CB and Gcode inside the macro .
To fix add in a wait state after the G95 call Forcing Mach3 to WAIT until it has completed the G95 call update. NOW you may have to add more or less wait states with YOUR system. It seems to be CPU related as to the waits required.
IF it were my code I would use the WhileIsmoving() Wend after each Code"" line to make SURE it stays in sync.
THAT is why I recommended you use a Gcode SUB routine call. It does NOT have the sync problems, But some of the latest version did have a bug that created a loop in the subs. DOn't know if that ever got fixed.
'M975.m1s Tapping Macro
'
'Set Editable Parameters in Main Program
'#1=0.36 (Set Thread Depth)
'#2=16.0 (Set Thread Pitch in Turns per Inch)
'#3=400 (Set RPM)
'#4=0.1 (Set Rapid Height)
'(Internal Parameters)
OrigFeed = GetOEMDRO(55)
CODE "#103=0.91" 'Underfeed, 0.91 -> 9 %
CODE "#104=[#103 * 1.0/#2]" 'feed rate adjusted for under feed
CODE "G95 F#104"
While Ismoving()
Wend
CODE "S#3 M3 M8"
CODE "G4 P4"
CODE "G1 Z[#103 * #1/-1]"
CODE "S#3 M4"
CODE "G4 P0.5"
CODE "G1 Z#4"
CODE "G94"
CODE "F" & OrigFeed