Ian,
I would not recommend using #1 - #30 as global variables. Try
something like this. It works for me.
#510 = 1.4 ( o.d )
#511 = 0.38 (root dia)
#512 = [[#510 - #511] / 2] (cut depth)
#513 = 5 (number of teeth)
#514 = 4 (length of cut)
#515 = [360/[#513]] (angular increment)
#516 = 0.09 (cutter thickness)
#517 = 1 (counter)
#518 = 1 (tooth counter)
#519 = 10 (step angle for rounding)
#520 = [[#510]/2] (radius of work)
#521 = 10 (increment for rounding steps)
#522 = 90 (final arc angle)
(cuts one slot in blank)
o100 sub [1] [2] ( declare the formal parameters -- I don't
know if this is necessary but it helps keep things straight )
G1 X[[#1]/2] F4
G1 Y[#2] F4
G0 Y[0-[#2]]
G1 X[#1] F4
G1 Y[#2] F4
G0 Y[0-[#2]]
endsub
O100 CALL [#512] [#514] (pass the variables or values that you want
to use as local parameters)
Good luck,
Alan
---
Alan Condit
1085 Tierra Ct.
Woodburn, OR 97071
Email -- [EMAIL PROTECTED]
Home-Office (503) 982-0906
On Aug 16, 2007, at Aug 16, 2007--3:23 PM, emc-users-
[EMAIL PROTECTED] wrote:
> Message: 7
> Date: Thu, 16 Aug 2007 23:24:07 +0100
> From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> Subject: Re: [Emc-users] Proglem with EMC script - understanding error
> message
> To: [email protected]
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> 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