Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 09:20:48 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  g-code save
Pages: 1   Go Down
Print
Author Topic: g-code save  (Read 606 times)
0 Members and 1 Guest are viewing this topic.
dunkers
Active Member

Offline Offline

Posts: 17


View Profile
« on: June 29, 2010, 09:31:38 AM »

Is there some way to save the g-code that Mach3 has loaded? The situation is that I'm writing a macro that will take some g-code file and adjust certain parameters in it, then feed that to Mach3 (using open/load teachfile). However, sometimes the g-code will originate from another wizard, which would use open/load teachfile itself, so I would need to be able to get to the generated g-code.

Logged
budman68
Master of the Custodial Arts, or better known as:
Global Moderator
*
Offline Offline

Posts: 1,994



View Profile
« Reply #1 on: June 29, 2010, 10:02:13 AM »

When you are ready to save it, couldn't you just open up whatever editor you're using to edit the GCode and save it somewhere by renaming it to a special folder you want to save it in?

Dave
Logged

----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    Wink
dunkers
Active Member

Offline Offline

Posts: 17


View Profile
« Reply #2 on: June 29, 2010, 10:27:11 AM »

I'm not editing g-code Smiley

The situation is that I'm making PCBs (but could be engraving - similar requirements). The width of the cut is critical and, since a v-cutter is used, the depth is also critical. We are talking 1 or 2 mil here. So, what my code (actually a wizard) will do is to firstly probe the surface of the copper to build up a 3D map. It will then load in some g-code, generated by a PCB CAD utility, and run through this fixing up the z-offsets to be relative to the 3D map it has of the PCB surface (thus negating any warping which would make the tracks be too thick/thin). The result is written to the teaching file, and then loaded and run. No manual intervention anywhere, except to specifiy the PCB file.

But... since the cutting depth is so critical the tool profile can affect things too. V-cutters don't have an infinite point, so working out the depth from the cutter angle is usually wrong. The cutters I currently use have a tip width specified at 0.2mm but the one I'm using right now is 0.17mm. Doesn't sound a lot of difference, but when the cutting depth is 0.15mm...

So, to resolve that issue I wrote a wizard that basically performs the kind of bracketing you might use for photo exposures: decide the value you want, then do some tests either side of that. My wizard takes the cutter details (angle, tip, etc) and target width, then works out the depth and generates code to cut a series of test tracks around that. For instance, if it figures the depth should be 0.15mm it might cut 5 short tracks of 0.11, 0.13, 0.15, 0.17 and 0.19. The actual cut width can then be checked and the correct depth chosen for that tool.

Trouble is that the results of the bracket test may not be correct because any warpage of the board hasn't been allowed for. So what I need is to take the code for the bracket test and feed that through the mapping wizard. I could do that by just writing to a known file, but it strikes me that sometimes the first wizard won't be one I wrote, hence I would need to be able to get to the code that's already loaded into Mach3 waiting to be run.

Hope that explains it better Smiley
Logged
budman68
Master of the Custodial Arts, or better known as:
Global Moderator
*
Offline Offline

Posts: 1,994



View Profile
« Reply #3 on: June 29, 2010, 10:31:52 AM »

It definitely explains it a bit better but unfortunately I'm not sure if Mach can do what you're asking.

I will leave this to someone better qualified as there are some very sharp folks around here that will be along very soon to help.  Wink

Dave
Logged

----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    Wink
ger21
Global Moderator
*
Online Online

Posts: 2,615



View Profile WWW
« Reply #4 on: June 29, 2010, 10:41:44 AM »

If it'sloaded in Mach3, can't you click the Edit G-code button and save it? Or does that not work?
Logged

dunkers
Active Member

Offline Offline

Posts: 17


View Profile
« Reply #5 on: June 29, 2010, 11:35:47 AM »

Very close, but I can't see how a wizard can get to the data in the editor. Granted, it could be used as a manual workaround (by saving to a file, then giving that to the wizard) but it's a non-obvious step and I'm trying to automate as much as possible.
Logged
ger21
Global Moderator
*
Online Online

Posts: 2,615



View Profile WWW
« Reply #6 on: June 29, 2010, 02:24:33 PM »

That's what happens when you don't read the whole question. Smiley
Logged

dunkers
Active Member

Offline Offline

Posts: 17


View Profile
« Reply #7 on: June 29, 2010, 02:48:16 PM »

I had missed the edit button, in looking for a save facility, and missed that the manual bit was doable. So a useful comment even if it wasn't the solution Smiley
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!