I spotted several more errors in your program.

> #10 = 1.4        ( o.d )
...
> #22 = 90        (final arc angle)
Parameters up to 30 are used for subroutine arguments.  Use parameters
above 30 for global variables:

    #40 = 1.4        ( o.d )
    ...
    #52 = 90        (final arc angle)

> 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

Numbers are required for the beginning and end of a subroutine, loop, or
conditional.  So your code should look more like:
    O200 sub ...
    O201 do
    ...
    O201 while ...
    O200 endsub
It's the missing "O100" for the first "endsub" that makes emc run off
the end of the program without doing anything -- it's looking for O100
endsub and nothing else will do.

> while [#10] LT [#22]
the correct syntax is
    O201 while [#10 LT #22]

> G1 Y[#14] F4
Brackets are not necessary here, but not harmful either

> N0500 [#17] = [#17] + 1    (increment counter)
The correct bracketing is:
    #17=[#17+1]
In addition to the original, these are both incorrect:   
    [#17]=[#17+1]
    #17=[#17]+1

> G0 Z[[sin[#10]/[#20]] X[[cos[#10]/[#20]]
The correct bracketing is:
    G0 Z[sin[#10]/#20]
if you want to compute what would be written sin(x)/y in many other
languages, or
    G0 Z[sin[#10/#20]]
if you want to compute what would be written sin(x/y) in many other
languages.

> N2000 o200 call [#10][#14][#20][#21][#22]
Inside O200 sub, you refer to #10, #14, #21, #21, and #22 which are the
numbers of the variables you intended to be global.  You could either
omit these parameters from O200 call and use the global variable numbers
once you renumber them to be above 30.  Or, inside O200 sub you could
refer to them as #1 through #5.

On Thu, Aug 16, 2007 at 11:24:07PM +0100, [EMAIL PROTECTED] wrote:
> 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
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
> 

-------------------------------------------------------------------------
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
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to