070325-2009 EST USA
sinha_nsit:
On a HAAS machine, similar to Fanuc, a G65 subroutine call allows parameter passing on the G65 line thru alphabetic addresses on the G65 line that map to local addresses in the called routine. The local addresses in a G65 subroutine (which is a separate O-numbered program) are independent of any other local addresses in any other G65 subrountine. My guess is that these local variables are stored on the computer stack. This means they are volatile, and may be unique.
Note: there is no way to pass values back to the calling program level other than thru common variables. Also, the local variables of a given level are not destroyed by calling a subprogram. But when you go up a level those on the level you go up from are destroyed.
Other subroutines than G65 do not allow parameter passing thru addresses on the calling line. Thus, common variables are used for parameter passing and these must be preset before calling the subroutine.
G65 subroutines at each level have a new set of local variables created.
I suspect that since M98 is an external subroutine call that its local variables are different than those in the calling program, but I have never tested this.
My guess is that a local subroutine call, M97, may share the local variables of the calling program. I might think to test this later or someone else can maybe check these.
You run tests like this by using a common variable to store the value of a local variable in the common variable for inspection later, or use DPRNT to output your test values.
.


LinkBack URL
About LinkBacks




Brain fart.