I'm rewritng a very old Gcode program to run on a Camsoft Pro control... FWIW, need more softjaws on a lathe that does not have reversible jaws, have to cut the teeth.

Anyway, my last two controls allowed versions of IFTHEN and GOTO to loop sections of code over and over (until condition is met) within the Gcode program. I'm not finding a way to do this in Camsoft Pro.

I'll get this part made by using M98, to get me by, today. I can see M98 just runs the GOSUB command. A clever person could find a way to implement loops and conditional logic within Gcodes using this, somehow.

Anyway, my question. Can I do loops (GOTO) and conditional branching (IFTHEN) within a Gcode prgram? How?

Karl

P.S. This is the code I'm reworking:

;TEETH,ADJUST TRUE SOFT JAWS
;set second jaw back 0.100", third back 0.200"

(*BLEC'*',CMST';',CNDL3,CNDR4,ZRSP0,PDOF0.05,FDOV0 *)

%LAPPER = 0
%ZDEPTH = 0.5000

%START:
%COUNTER = 0
%ZDEPTH = %ZDEPTH + 0.025 *;DEPTH OF CUT FOR EACH PASS
%LAPPER = %LAPPER + 1

G92 X 0.00 Y 0.00 Z %ZDEPTH
G90
G00 X 0.000 Y -0.250 Z 0.00


%LOOP:
%COUNTER = %COUNTER + 1

G42 T 02
G01 X 0.008 Y 0.000 F 3.0
G01 X 0.122 Y 0.000
G03 X 0.096 Y 0.750 I -1.304 J 0.330
G01 X 0.000 Y 0.750
G02 X 0.008 Y 0.000 I -3.986 J -0.420
G01 X 0.008 Y -0.125
G01 G 40 X 0.2857 Y -0.25
G92 X 0.000 Y -0.25 Z 0.00

IF (%COUNTER LE 9) GOTO %LOOP

G54
G00 X 0.00 Y 0.00 Z 0.00

IF (%LAPPER LE 5) GOTO %START *;DO ALL TEETH 5 TIMES