![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| G-Code Programing Discuss G-code programing and problems here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
Hi, I've been lurking for a while and now I think I have a real question. I have a small gantry mill I built out of a PC Puncher and I've been using CorelDraw to make DXF files which I then import into Mach2. Using Mach2 I make GCode files to run the mill. I'd like to be able to write programs to automatically modify the GCode files I get from Mach2 so that the files can be customized for my (and my machine's) particular needs. I haven't done much programming since grad school (egads, it was QuickBasic!) and I'd like to know the simplest way to massage the GCode I get out of Mach2. As it is now, I load them into Notepad and write in my llittle chunks of code manually. This is time consuing and wholly unsatisfying. I'm pretty sure I can get up to speed with any appropriate programming language, but I'm not interested in completely making my own tool paths I'd just like to modify ones from mach2 or...any suggestions. Thanks, Dave |
|
#2
| |||
| |||
| 080220-0912 EST USA You have not indicated the type changes you need to make. Tool change and offset loading might be quite different for different machines. For example Anilam to HAAS. These might be complex multi-line instructions and not easy to make a general translator. I am not familiar with Mach2, but suppose it can work with G12 and your machine does not understand this code, then that is easier to do. I would use a QBasic program to do the search and extract parameters and synthesize the code. You also might try Perl. I believe this is free or available with a book you buy. . |
|
#3
| |||
| |||
Thanks for the reply, gar. Mach2 comes with pretty good documentation and the commands look pretty straight forward, so I'm not too worried about getting the code right. Your suggestion of Perl is much appreciated, as I can't locate my old Quickbasic program. Most of the changes I need to make on the programs generated by Mach2 involve turning my vacuum collector on, starting the mist lubricator and some other operational commands. I do, however, also have to add tool offsets for particular cuts and also a tangential approach for edge cutting. I've done these modifications in the notepad editor accessed in Mach2 but I'd like to be able to input the initial programs into a secondary program (possibly in "Perl", as I now know!) and have them done automatically. Thanks again for the reply, I'm going to investigate Perl tonight and see if it will do what I want. Dave |
|
#4
| |||
| |||
| 080221-1011 EST USA Dave: The Perl book I have is from 2000 and was published by Sams. "Sams Teach Yourself Perl in 24 Hours". It includes a disk and was about $25. I have only played with Perl a little. It is an interpreter and at the time I played with it there was not a good compiler so if I provided a program to someone they could easily copy the code and modify it. If you strictly use it for your own purposes, then this is not a factor. My son uses it for complex applications such as his web site www.office1000.com . Perl has a lot of structure like C. . |
|
#5
| |||
| |||
| Couple of suggestions, though again it depends on the level of translation needed. You could use the excellent ultraedit text editor (www.ultraedit.com) and setup macros to do what you need *if* it's not too complicated. It has a great search and replace that can use 'Regular Expressions' (if you understand them). You can get a free trial of this. If it's more complicated and you can dust off the cobwebs enough to learn BASIC again, then I'd suggest PowerBasicCC (PBCC) might be a good start (www.powerbasic.com). It's the Console Compiler (DOS window if you like) version of the 32 bit PB language. It's quite similar to QuickBasic in the programming and still uses text instead of windows, but is actually a 32bit Win program under the hood (just be aware of slow screen writes with some OS's, though there are ways around that and they likely won't affect your type of prog). It has some nice string (text) editing features that may help with what you want. No trials unfortunately and it's about $160 US, but it may be worth it for you. Another possibility is Powergrep from JG software (www.jgsoft.com) along with their Regex software (for info on what regular expressions are, see their site). Think you can get a trial of powegrep, don'think so with regex, but they do offer a money back guarantee. |
| Sponsored Links |
|
#6
| |||
| |||
| Thanks GrantM, I've looked at the possibilities you suggested and it looks like powerbasic might do the trick. Before I take the (monetary) plunge, however, do you know anything about "FreeBasic"? It would appear that it's a continuance of a QuickBasic-type program that's been developed by a group of ex-QuickBasic users who liked the program and wanted to keep using it. Before I jump in and try to use it, I'd love to know what it's about. Dave |
|
#7
| |||
| |||
| Don't think I've tried it. I did a lot of hunting around for decent basics years ago and ...well ...lets just say some weren't all that great. Not sure about freebasic, can't recall. There are heaps of BASIC related sites and I do recall finding a site on google that did a review of a stack of them - sorry cant' recall what the site was. I do have QB45 still, though not sure that it would suit your needs - very limited memory don't forget. |
|
#8
| |||
| |||
| Hi Dave - not sure if I'm a tad late here but... I never used Mach2 - oldy worldy - Mach3's the name of the game now. But anyway Mach doesn't create gcode from DXFs - it runs (interprets) Gcode to drive your machine, so I think you may mean the LazyCAM that comes bundled with Mach3 - it indeed takes DXFs and produces gcode for Mach. The point is that LazyCAM should be producing exactly the right gcode for Mach cos that's what it does! - if you need to edit your gcode then somethings wrong. Got any more details? |
|
#9
| ||||
| ||||
| Stirling, Mach2 (and earlier versions of mach3) had a .dxf importer that converted the drawing to g-code, fast and simple. Not as powerful as LazyCAM, but it worked great...all the time. However, there was no way to add the M codes that Dave wants to add.
__________________ Gerry Mach3 2010 Screenset http://home.comcast.net/~cncwoodworker/2010.html (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#11
| ||||
| ||||
|
If it works fine and does what you need, then why upgrade? But if you're new to Mach, start with the newest.
__________________ Gerry Mach3 2010 Screenset http://home.comcast.net/~cncwoodworker/2010.html (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#12
| |||
| |||
| GrantM, stirling and ger21, Thanks so much for the info, not having used Mach3 I've wondered what has changed since I got Mach2. I've been playing (briefly) with FreeBasic and so far I'm very pleased. It not only has the functionality of the old QuickBasic, but it also has added features that let you use libraries from other languages (about which, unfortunately, I have no clue!). At this point I'd like to figure out how to use FB to edit the windows registry so that I can use some sticky values and also possibly automate the file modifications I'd like to do. I'm trying to make a program that I can teach other people to use (family make great cheap labor!) so that I can go about doing fun stuff like building better machines. Dave |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simple GCode Reference / Commands? | WarrenW | G-Code Programing | 14 | 11-30-2010 03:03 AM |
| Please Help!! Simple 3-D part not so simple for me | eaglegage | Mastercam | 16 | 05-15-2008 10:00 AM |
| Simple Question Simple Answer ? | p3t3rv | Stepper Motors and Drives | 6 | 02-16-2006 09:00 AM |
| I have a problem with my gcode or my conversion to gcode , everything is tiny? | NickLatech | G-Code Programing | 0 | 03-10-2005 12:46 PM |
| gcode to gcode converter | july_favre | General CAM Discussion | 4 | 05-24-2004 06:51 PM |