Re: NC subprograms



I ended up using subprograms for EVERYTHING. M98 is "call subprogram" and
M99 (replaces M30 at end of subprogram) is
"return to main program". I also wanted 2 areas on screen with
main program in one and current subprogram (if any) in the other.
The area where the program scrolls is not very wide, it seems like this
would fit if it's worth the work to put it there.

Dave

>You are right that subroutines are not implemented in either the current
>interpreter or in the comming six axis version.  It has something to do
>with the machine model that is used by the interpreter to develop the
>cannonical calls but I'm no expert here!
>
>I have experimented with with running NC files in sequence using a Tcl/Tk
>popup.  
>
>I'd modify your suggested program like this: 
>
>N10 (gosub subfilename) g4 p0.5
>N12 M30
>
>The dwell gives Tcl/Tk time to read the comment and find the gosub.  When
>it encounters "gosub" it pauses program execution and reads the current
>line number of that file. Then the GUI resets the interpreter and loads the
>subprogram and starts it.  
>
>When EMC idles after the subprogram, the GUI again resets the interpreter
>and restarts the main program from the last active line + 1.
>
>Swapping programs this way costs about a second total but does provide a
>way to accomplish what you are trying to do.
>
>If you would like to try it out, I'll clean it up and email it to you.  It
>would be easiest to use with the tkemc GUI but I could build a stand alone
>that you could run with xemc as well.  This offer als applies to anyone
>else on the list.
>
>If the routine seems to be viable, after I get some initial feedback, I'll
>release it as a script on the dropbox.
>
>Ray
> 




Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact