CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > G-Code Programing


G-Code Programing Discuss G-code programing and problems here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 02-18-2008, 10:44 PM
 
Join Date: Jun 2006
Location: USA
Age: 55
Posts: 3
AluminumDave is on a distinguished road
Need suggestions for massaging simple GCode files.

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
Reply With Quote

  #2   Ban this user!
Old 02-20-2008, 08:25 AM
gar gar is offline
 
Join Date: Mar 2005
Location: USA
Posts: 1,498
gar is on a distinguished road

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.

.
Reply With Quote

  #3   Ban this user!
Old 02-21-2008, 08:33 AM
 
Join Date: Jun 2006
Location: USA
Age: 55
Posts: 3
AluminumDave is on a distinguished road
Thanks for the suggestion

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
Reply With Quote

  #4   Ban this user!
Old 02-21-2008, 09:22 AM
gar gar is offline
 
Join Date: Mar 2005
Location: USA
Posts: 1,498
gar is on a distinguished road

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.

.
Reply With Quote

  #5   Ban this user!
Old 02-21-2008, 12:06 PM
 
Join Date: Feb 2008
Location: Australia
Posts: 26
GrantM is on a distinguished road

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.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 02-25-2008, 07:44 PM
 
Join Date: Jun 2006
Location: USA
Age: 55
Posts: 3
AluminumDave is on a distinguished road

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
Reply With Quote

  #7   Ban this user!
Old 02-27-2008, 06:15 AM
 
Join Date: Feb 2008
Location: Australia
Posts: 26
GrantM is on a distinguished road

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.
Reply With Quote

  #8   Ban this user!
Old 03-07-2008, 06:25 AM
 
Join Date: Aug 2007
Location: England
Posts: 213
stirling is on a distinguished road

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?
Reply With Quote

  #9  
Old 03-07-2008, 07:23 PM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,455
ger21 is on a distinguished road
Buy me a Beer?

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)
Reply With Quote

  #10   Ban this user!
Old 03-08-2008, 03:22 AM
 
Join Date: Aug 2007
Location: England
Posts: 213
stirling is on a distinguished road

thanks Ger - I didn't know that. Is there some advantage to sticking with Mach2 over 3 then?
Reply With Quote

Sponsored Links
  #11  
Old 03-08-2008, 06:00 AM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,455
ger21 is on a distinguished road
Buy me a Beer?

Originally Posted by stirling View Post
thanks Ger - I didn't know that. Is there some advantage to sticking with Mach2 over 3 then?
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)
Reply With Quote

  #12   Ban this user!
Old 03-08-2008, 08:47 PM
 
Join Date: Jun 2006
Location: USA
Age: 55
Posts: 3
AluminumDave is on a distinguished road

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
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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




All times are GMT -5. The time now is 10:08 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361