Hi again, Thanks to everyone who responded to my earlier mailing. As a result and after a considerable rewrite and correction I have now managed to get the script to load - however, it does nothing!! When I hit 'R' or press the play button, the screen flashes briefly and returns to the stop state - the machine doesn't even twitch... Do I have a problem in trying to run nested 'do - while' loops, its the only thing I can think of that might do nothing. there are no error messages displayed. Here is the rewritten script - any advice would be very welcome. Thanks.. Ian
% #10 = 1.4 ( o.d ) #11 = 0.38 (root dia) #12 = [[#10 - #11] / 2] (cut depth) #13 = 5 (number of teeth) #14 = 4 (length of cut) #15 = [360/[#13]] (angular increment) #16 = 0.09 (cutter thickness) #17 = 1 (counter) #18 = 1 (tooth counter) #19 = 10 (step angle for rounding) #20 = [[#10]/2] (radius of work) #21 = 10 (increment for rounding steps) #22 = 90 (final arc angle) o100 sub (cuts one slot in blank) G1 X[[#12]/2] F4 G1 Y[#14] F4 G0 Y[0-[#14]] G1 X[#12] F4 G1 Y[#14] F4 G0 Y[0-[14]] endsub o200 sub (rounds half top of pinion leaf in several steps) do G0 Z[[sin[#10]/[#20]] X[[cos[#10]/[#20]] G1 Y[#14] F4 G0 Y[0-[#14]] G0 A[#21] #10 = [[#10]+[#21]] while [#10] LT [#22] endsub o300 sub (rounds other half top of pinion leaf in several steps) do G0 Z[0-[[sin[#10]/[#20]] X[[cos[#10]/[#20]]] G1 Y[#14] F4 G0 Y[0-[#14]] G0 A[0-[#21]] #10 = [[#10]+[#21]] while [#10] LT [#22] endsub N0100 G92 X0 Y0 Z0 (set axes to zero) N0200 G21 G91 (metric units, incremental moves) N0300 do (first cut of pinion leaves) N0400 o100 call [#12][#14] N0500 [#17] = [#17] + 1 (increment counter) N0600 G0 A[360/[#13]] (rotate work one tooth distance) N0700 while [#17] LT 5 N0800 [#17] = 1 (set counter back to 1) N0900 G0 A[0-[[#15]/3]] (rotate by thickness of pinion leaf and) N1000 G0 Z[#16] (move cutter - saw - to other side of leaf) N1100 do (cut other side of pinion leaves) N1200 o100 call [#12][#14] N1300 [#17] = [#17] + 1 N1400 G0 A[0-[360/[#13]]] N1500 while [#17] LT 5 N1600 [#17] = 1 (set counter back to 1) N1700 G0 A[[#15]/6] (move cutter to centre of leaf) N1800 G0 Z[0-[[#16]/2] ( ) N1900 do (round over half the leaf and repeat for all leaves) N2000 o200 call [#10][#14][#20][#21][#22] N2100 #17 = [#17] + 1 N2200 G0 A[360/[#13]] N2300 while #17 LT 5 N2400 #17 = 1 (set counter back to 1) N2500 G0 Z0 A-90 (set cutter and pinion leaf back to centre) N2600 G0 Z[[#16]/2] N2700 do (round over other half the leaf and repeat for all leaves) N2800 o300 call [#10][#14][#20][#21][#22] N2900 #17 = [#17] + 1 N3000 G0 A[0-[360/[#13]]] N3100 while #17 LT 5 N3200 #17 = 1 (clean up) N3300 G0 X-20 Z40 Y50 (retract tool) N3200 G30 % -- Best wishes, Ian ____________ Ian W. Wright Sheffield UK "The difference between theory and practice is much smaller in theory than in practice..." -- Best wishes, Ian ____________ Ian W. Wright Sheffield UK "The difference between theory and practice is much smaller in theory than in practice..." ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
