CAD CAM EDM DRO - Yahoo Group Archive

Re: [CAD_CAM_EDM_DRO] re:gcode vars and subs was Re: Re: Scanr/Digi skip funct/probe detls

Posted by Smoke
on 2001-01-06 21:55:20 UTC
Ballendo, way back when I originally went to computer school, I learned
programming using the command set as well as programing with 1's and 0's.
This was before PC's were even invented. Programming with 1's & 0's is
trully a bitch. Programming with the command set was decidedly easier. The
command sets have commands like "go to" and "return". I don't know how
you and other programmers define "sub-routine" and
sub-program" these days but, if you stop and THINK about it a sub-routine
and a sub-program are the same thing with different names. Using either one
of them means you have a "go to" command buried somewher in your main
program.

Using your comment in the paragraph below...any "sub-routine" is in reality
a sub-program...albeit a much smaller one than what you probably consider a
sub routine to be. Incidently...a sub-routine doesn't NEED to be located
anywhere specifially in a program either. the "go-to" command tells the
main program to look for the sub-routine (sub-program) at line number xxxxx.
Now this line numbe could be line 20, line 200, line 2000 or any wehre else.
I was merely pointing out that having all the little sub-routines in the
smae location (someone mentioned having them at the begining of the
program...but they could all be just as easily be somewhere in the middle or
at the end) was logical. It makes it very easy to find the one you want
should changes (or removal and replacement as you mentioned) become
necessary. I would prefer them at the beginning, since most programs do
start at the begining upon opening.
"SPOCKIAN"!

Smoke

>The real advantage to having subPROGRAMS rather than subroutines (and
>calling them by their Onnnn program number with an M98 is that ANY
>program can 'become' a sub-program at ANY time! It just has to be in
>the control memory!
>And it can just as easily be removed and replaced without changing
>the orig. program (just rename the 'improved' program to the Onnnn
>number 'called by' the M98!)
>
>Hope this helps.

Discussion Thread

ballendo@y... 2001-01-06 17:35:58 UTC re:gcode vars and subs was Re: Re: Scanr/Digi skip funct/probe detls Smoke 2001-01-06 21:55:20 UTC Re: [CAD_CAM_EDM_DRO] re:gcode vars and subs was Re: Re: Scanr/Digi skip funct/probe detls