G-Code Parser for Windows

Discuss Laser CNC Software Issues

G-Code Parser for Windows

Postby awesomenesser » Tue Jan 24, 2012 8:40 pm

A while ago I developed a post processor in Visual Studio (C#) so that I could convert GCode to work with my Mach3. Somebody asked me if they could use it so I figured I should go ahead and post it.

Here is the installer: G-Code Parser Installer

I tried to make the software as reliable as possible but I am sure somebody will find some bugs so if you do find some send me a pm. I have been using it to parse gcode files from my CamBam trial for the past 6 months and have never had an issue with the output gcode files.

The software works by padding each rapid movement (G0) with an M5 and M3 commands which I use to turn the laser on and off. This is a very simple method but it does involve going into Mach3's files and changing the way Mach3 interprets M3 and M5 codes (This is very easy to do).

Go to "C:\Mach3\Macros\<Your mach3 profile name>\m3.m1s" and edit it to say "activateSignal(OUTPUT1)" (no quotes)
Go to C:\Mach3\Macros\<Your mach3 profile name>\m5.m1s and edit it to say "deactivateSignal(OUTPUT1)" (no quotes)

The reason I used this method is because I never could get the E1P0/E1P1 commands working I think my Mach3 was too old (I have the new version now so I might look into adding those commands if people are interested).

Using the Program
I tried to make the program as user-friendly as possible. I made it so that it can be used in a windowed mode or in a system tray icon (default). You also have the option on making it startup with windows (not set by default). This way you can run it in the background while running Mach3 and not even notice it is there. In the system tray version just right click on the gear icon and choose parse file. You will them be promped with an open file dialog once the file is opened it is parsed. Then when the file is complete a balloon will pop up alerting you that it is complete. The file is saved in the same directory and it appends "_parsed" to the file. So everything happens in the background.

Screenshot 4.png
The icon is the little gear.
Screenshot 4.png (8.94 KiB) Viewed 7167 times

Screenshot 6.png
Here is a screenshot of the balloon message.
Screenshot 6.png (5.97 KiB) Viewed 7167 times

I also added the following commands to turn on and off the Air Assist and Exhaust (Actually Flood and Mist). I didn't have top modify anything to use the following I just set flood and mist to the relay outputs on Barts interface board. These are also optional and if somebody wants I can add more features at a later date.

Additional Commands
M7 - Turns on my exhaust
M8 - Turns on my air assist
M9 - Turns off my exhaust and air assist

Screenshot 5.png
This is the windowed mode.

Here are some sample files which I converted using this software:

Mounting Plate.nc
Here is an original file from CamBam.
(1.73 KiB) Downloaded 905 times

Mounting Plate_parsed.nc
Here is an example parsed file.
(2.08 KiB) Downloaded 905 times
Posts: 110
Joined: Wed Mar 02, 2011 4:07 pm

Re: G-Code Parser for Windows

Postby Greolt » Tue Jan 24, 2012 9:33 pm

Very interested in what you are doing here.

I am just in the final stages of a build that will initially use Mach3 and gcode. Been using Mach3 for years and am familiar with it.

You might be interested in this post and the surrounding discussion Re Mach3 and laser control.


http://www.machsupport.com/forum/index. ... #msg143337

EDIT: I am wondering if you can rewrite the CamBam Post Processor to include the gcode changes that you need. One less software step.

This is what I have done with Vectric.
Posts: 127
Joined: Tue Nov 29, 2011 7:22 am

Return to Software

Who is online

Users browsing this forum: No registered users and 2 guests