CAD CAM EDM DRO - Yahoo Group Archive

gcode vars and subs wasRe:re: Scanr/Digi skip funct/probe details?

Posted by ballendo@y...
on 2001-01-06 15:20:26 UTC
mariano wrote:
<snip>for example you could define your subroutine at the beginning
>of the program , as per example
>g57r1 ( definition of subroutine)
>G00 X0.Y50. ZV1(use variable 1 for Z) G1 G42 HV2 Y10. G1 X30.
>G00Z10. G40X0Y0 G58( subroutine ends) T1 m6 f.1s1000m3 G00Z25 T1 01
>G55V1A-10. V2A2.(Z = -10. remember ZV1 above, HV2 offset for
>G42=2MM ) G59R1( exec the subroutine) I firmly believe that the
>above method is much more easier to learn vs the other systems<snip>

This is the same syntax (for variables) as CncPRO, except the A is
used (A for Attribute???) instead of =. I would use the = since an A
axis is a common thing, but otherwise what mariano wrote makes sense.

However, M98 (call subprogram) and M99 (return from subprogram) have
become/ are becoming the 'standard' sub call method.

The use of G57 (define subroutine),G58 (End of subroutine), G59
(Execute subroutine) does not seem to me to be any better than:

...(A program listing)
...
...
M98 P123 (call program 123 as a subroutine)
(sometimes the P is a Q, or an O)

O123 ( The LETTER O is often used to label the program start)
... (the program lines)
...
...
...
M99 (Some controls will not use m99, M2 is another choice)

Many commercial controls limit subroutines to 4 levels deep.(Nesting)
Personally, I feel both methods will work. BUT,...

The use of subPROGRAMS seems to be easier for beginners and more
MAINTAIN-ABLE in the shop. Same way subs in computer programming have
replaced gotos'

Hope this helps.

Ballendo

Discussion Thread

ballendo@y... 2001-01-06 15:20:26 UTC gcode vars and subs wasRe:re: Scanr/Digi skip funct/probe details?