Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: jgsturbo on December 04, 2013, 02:29:54 PM

Title: G code program inside a g-code program?
Post by: jgsturbo on December 04, 2013, 02:29:54 PM
Is there a way to load a g-code program inside a base program without mach loosing its place inside of the base program?
Kind of like calling up a sub-program but I would like it to be a separate file.
Title:
Post by: Bodini on December 04, 2013, 03:15:54 PM
I dont think so. Like u said, sub routine is about as close as u can get.
Title: Re: G code program inside a g-code program?
Post by: jgsturbo on December 04, 2013, 03:38:33 PM
I guess I'll need to string them together?
Title:
Post by: Bodini on December 04, 2013, 03:43:31 PM
How much gcode are you talking about? You could call gcode from a macro, but id only use that for a couple of lines.
Title: Re: G code program inside a g-code program?
Post by: Chaoticone on December 04, 2013, 04:30:04 PM
You could also load and run a g code file from VB. You could have a m code that loads a g code file runs it, closes when finished, loades anohter Gcode file, etc. I'm pretty sure. Never done it myself but everything is there to do it with.

Brett
Title: Re: G code program inside a g-code program?
Post by: BR549 on December 04, 2013, 07:17:31 PM
Gocde Programs with outside subs work just fine in mach 3 as long as you are not running tool comp or nested too deep with the subs.

Macros running gcode work also as long as you maintan proper sync between the Macro and Gcode.

Each way has its own quirks about it.

(;-) TP
Title: Re: G code program inside a g-code program?
Post by: jgsturbo on December 04, 2013, 09:28:30 PM
Can I read a userDRO into a filename as a variable?
Title: Re: G code program inside a g-code program?
Post by: Bodini on December 05, 2013, 09:27:40 AM
Gocde Programs with outside subs work just fine in mach 3

Interesting! How do you call an outside sub?
Title: Re: G code program inside a g-code program?
Post by: BR549 on December 05, 2013, 11:28:26 AM
M98 (SubName.tap)   to call an outside sub.

Yes you can read a UserDro into a filename as a variable.

(;-) TP

Title: Re: G code program inside a g-code program?
Post by: jgsturbo on December 05, 2013, 11:38:49 AM
Thank you  BR549! I did figure out how to read values into names... I think.
Code: [Select]
code "M98 ("&value1".NCF")"?
Title: Re: G code program inside a g-code program?
Post by: Bodini on December 05, 2013, 12:16:01 PM
M98 (SubName.tap)   to call an outside sub.

Ah ha!  I remember that now but I never had much luck with it loading the outside file.  I ended up just using subs inside the gcode, which is a thing I still use daily.

Addendum: Thats why i said I'd 'limit it to a few lines of code' in previous post.  (Previous failed experience) ;-)