What is an NC Viewer?
An NC Viewer is a software tool that helps you work with your cnc machine’s nc files. NC files, also called g-code files, are the files that tell your cnc machine how to make parts, so this is pretty important.
NC Viewers go by many names including:
- NC Viewer
- GCode Viewer (or G-Code Viewer)
- GCode Simulator (or G-Code Simulator)
- G-Code Editor (or GCode Editor)
Incidentally, the “NC” in nc viewer and nc file stands for “Numerical Control.”
Here’s a typical example, our own viewer software, which we call G-Wizard Editor:
What are NC Viewers Good For?
An excellent question, and the answer is that nc viewers are tools with many uses:
- Creating and editing g-code.
- Understanding what g-code does. The file name may not provide much information, and g-code itself is pretty cryptic. An NC Viewer can not only give you a 3D backplot of how the tool will be moved by the g-code (the toolpath), it can tell you a lot else about that g-code.
- Testing g-code before it goes on a machine to make sure it will run as expected. This can be a real cost savings if the machine can be kept running rather than having to “cut air” for any new programs.
- Fixing or Improving G-Code. You may be surprised to learn there are many things you can do in g-code that are nearly impossible in cam software. And you’ll be equally surprised when your CAM outputs some g-code that’s wrong (Ouch!).
- Estimating the run time of g-code, perhaps for quoting and cost estimation.
- Improving a developing a custom post for your CAM Software programs.
If you’re a CNC Programmer, you should have an nc viewer. A good g-code simulator can save you time and make you a real wizard compared to those who don’t have the tool.
How to Choose your NC Viewer: 9 Key Power Tools
Let’s start out with something that should be obvious–don’t choose a text editor as your software for dealing with g-code. Even one that has a few extra bells and whistles like Notepad++ is nowhere near as powerful as a real NC Viewer.
Let’s go over what to look for when shopping for an NC Viewer. Below are the 8 Key Power Features I would most like to have any time I’m working on a gcode file.
Support for G-Code Dialects
Can you run any g-code on any cnc machine?
No, of course not! CNC machines have their own dialects. In many cases they are similar, but the details matter a lot.
Unfortunately, the vast majority of nc viewers don’t have any way to adjust for particular g-code dialects. They simply assume a fairly generic dialect and ignore anything they don’t understand.
Of course if you were using the g-code simulator to find bugs in g-code files before running on the machine, there are many that can slip by such generic software programs. A real g-code simulation has to simulate your machine’s g-code, not some other imaginary machine’s!
Here is our G-Wizard software’s post selection showing a few of the available posts:
Real 3D Backplot
A graphical backplot is the first thing you’ll notice and the feature you’ll use the most on your nc viewer. Its a visual view of the tool path and really the epitome of g code simulation. Make sure the program you select has a good one.
Here’s a closeup of G-Wizard Editor’s backplot view showing the tool path in green and rapids moves in red:Notice the different views and the icons to adjust and position the backplot as needed so you can really focus on what part of the tool path you’re interested in. The best g-code simulators have that.
G-Code Debugger with Single Step and More
This is critical to understanding what the g-code is doing so you can find and fix bugs or improve the g-code. Single stepping is the ability to have one g-code executed each time you press a button or click with your mouse.
The more information you can get about the state of the simulated machine the better. At the least you should be getting the XYZ position and the spindle speed. Also handy would be seeing the values of g-code variables and the modes that have been set.
Any features that can allow you to get through uninteresting g-code more quickly than single stepping are also handy time savers for this kind of work.
Here is G-WIzard’s Debugger set up for single stepping:Note the single step controls on the toolbar give a lot of options to move more quickly than just a single step. You can even move to the next tool change or rapids. Or you can put a dwell (G04) into the code and go to it with a single click. Also note the information displayed below the backplot tells you the modes and other handy info about the state of the simulated machine.
Support for Macro Variables, Development, and Debugging
Some nc viewers, particularly if they’re simple free versions, don’t recognize or process Fanuc Macro B syntax. Don’t bother with such software, as macros are one of the things that make it worth fussing with g-code directly.
Our G-Wizard software can check for infinite loops and has a special view that tells you all the different macros being accessed within the gcode file you have loaded. It can even let you give symbolic names to the macros and variables using Fanuc SETVN-style syntax. Except it works for any control, not just Fanuc.
What errors can the nc viewer find? Some cheap versions don’t report any except perhaps g-codes they don’t understand. They rely entirely on the backplot to show up any problems.
Backplots are great, but they don’t tell nearly the whole story. For example, if you specify an arc in g-code, small errors may cause the distance from the 2 endpoints to the arc center can differ for each endpoint. If that difference is too great, most machine controllers will refuse to execute that code and will report an error code.
Other kinds of error checking features can be quite extensive. For example:
- Check whether the spindle is spinning when the tool moves in to an actual cut.
- Allow limits to be set for each axis and alarm if the cutter is moved outside the limits. This can save a world of hurt by spotting potential crashes during simulation.
- Expression errors in calculated values. Things like divide by zero and such.
- Missing subroutines.
The list of errors for a full analysis of what can go wrong is quite long.
Tool Management and Support
Having the correct tools installed on the machine and called up is important. Being able to view the tools and information about how the program uses each one can be very helpful.
Here is G-WIzard Editor’s tool view:You have the ability to show both the overall list as well as every tool change in the program. You can double click to go to the change. You can change the backplot color of a particular tool to make it stand out. You can turn tool visibility in the backplot on our off so you can see tools of interest more clearly. And you can associate tools with Tool Crib entries that have a full definition of the tool for reference.
Automated Program Revision Commands
The revision commands can save tremendous time and give quite a lot of power. They can be applied to the whole nc file or just some subset of lines that the user has selected.
The types of revisions that can be made include features like:
- Add or delete white space.
- Adjust addresses with some arithmetic. Shift them all over by some X or Y offset for example.
- Adjust arc formats, such as changing between IJK and R format.
- Conversion from absolute to relative coordinates and vice versa.
As you work with g-code, you’ll see just how useful these tools can be. Make sure your chosen nc software tool has as many of these as possible.
G-Code Info and Reporting
A line of g-code can do a lot. What does your nc viewer tell you about that line?
A cheaper software viewer might not give you anything but the g-code itself and the backplot. There’s so much more possible that’s very handy to have such as a simple English translation of what the line is doing and additional information like what the radius and center of any arc are.
How about making clear the effect of acceleration on nc file execution time? On most machines, a lot of the g-code never gets to full commanded speed because of acceleration effects.
Here is G-Wizard’s Info tab which gives you tons of summary information about the nc file:
Another very useful feature is having the ability to generate reports with this information. Getting that all out of the viewer software and into a general format like a spreadsheet opens up a lot of possibilities for your analysis and massaging of the nc file.
Conversational G-Code Generator
Perhaps the ultimate feature an nc viewer can offer are Conversational Wizards. They will generate g-code for you for simple things like hole cycles, or simple cuts. They can be incredible time savers compared to having to go back through CADCAM to add some minor feature to the g-code.
Here are the different Conversational Wizards available in G-Wizard Editor:
Conclusion: Try an NC Viewer Today
We’ve given you an idea of what a good nc viewer can be used for as well as what features make up a good viewer. Our G-Wizard G-Code Editor and Simulator has all of those capabilities (natch!). You should try the free 30-day trial to get hands on experience with what a powerful viewer can do for you.
[ Free Trial of G-Wizard editor ]
You’ll be buzzing through your g-code files in no time with G-Wizard helping out.
Like what you read on CNCCookbook?
Join 100,000+ CNC'ers! Get our latest blog posts delivered straight to your email inbox once a week for free. Plus, we’ll give you access to some great CNC reference materials including:
- Our Big List of over 200 CNC Tips and Techniques
- Our Free GCode Programming Basics Course
- And more!
Just enter your name and email address below:
100% Privacy: We will never Spam you!
Bob is responsible for the development and implementation of the popular G-Wizard CNC Software. Bob is also the founder of CNCCookbook, the largest CNC-related blog on the Internet.