OK I tried a few different avenues and am having trouble getting the right code, or at least written correctly maybe. I got the program to behave properly using repeat. Downside for me is no piece counter for me to know how far along in the program I am. I determined that I can get 85 widgets out of the chunk of stock with enough material left for the collet to hold + safety margin.
I got it to run using this code with the idea of using the B m99 counter as my current run counter. The problem I encountered with it is the counter does not increment every time. For 37 pieces the counter went up 16. This leads me to believe I have coded it incorrectly but am stuck figuring out why.
(OD Turn G-code generated: Mon Apr 27 10:39:35 2020 <v2>)
(PathPilot Version: 2.4.3)
(Description = od)
(Material = Aluminum : -any-)
(Units = G20 inches)
(Work Offset = G54)
(CSS Max. Spindle RPM = 2500)
(Tool Number = 1)
(Tool Description = wnmg dorian jetstream)
(Tool Type = rtp_turn)
(Tool Orientation = 2)
(Tool Radius = 0.0160)
(Rough CSS = 250 feet/minute)
(Rough Feed inches/revolution = 0.0050)
(Rough Depth of Cut = 0.0030)
(Finish CSS = 250 feet/minute)
(Finish Feed inches/revolution = 0.0050)
(Finish Depth of Cut = 0.0020)
(Initial Diameter = 1.0000)
(Final Diameter = 0.9950)
(Z Start Location = 0.0000)
(Z End Location = -0.1000)
(Fillet Radius = 0.0000)
(Tool Clearance = 0.0050)
(Tool on X+ side)
m98 p500
o500
(----- Start of G-code -----)
(<cv1>)
G7 (Dia. Mode)
G18 (XZ Plane)
G90 (Absolute Distance Mode)
G40 (Turn Cutter Compensation Off)
G20 (units in inches)
G54 (Work Offset)
((((((actual program removed for brevity))))))
g30
(End ExternalCode)
o600 if [#5653 lt 85]
m99
o600 endif
m30