6140
« on: December 24, 2010, 08:11:22 PM »
I am not sure what you have going with teh code you posted But I get the general idea of what you are trying to do. You application is really simple and really you won't save time either way. The straight Gcode would be the best approach .
Straight Gcode Example:
F20
G01 X2 Y0
A2.5
A0
A1.7
G01 X9
A2.5
A0
A1.7
G01 X14
A2.5
A0
A1.7
G01 X15 Y5
A2.5
A0
A1.7
G01 X0 Y4
A2.5
A0
A1.7
G01 X1
A2.5
A0
A1.7
M30
%
SUB program approach: THe M98 calls the sub by the o word and name o100 the L paramter tells how many times to run the sub. At the end of the sub the M99 returns to the call line then advances to the next line. At teh end of the program the M30 ends the program
F20
G01 X2 Y0 M98 P100 L1
G01 X9 M98 P100 L1
G01 X14 M98 P100 L1
G01 X15 Y5 M98 P100 L1
G01 X0 Y4 M98 P100 L1
G01 X1 M98 P100 L1
M30
o100
G1 A2.5
G1 A0
G1 A1.7
M99
%
Hope that helps, (;-) TP