Customized Apps and Coding for CNC Machines

CNC machine programming services
Typical Siemens 840D main operator control panel.

Advanced CNC Solutions specializes in developing custom Excel applications to generate CNC code for unique controllers.

Extensive experience in Excel VBA code writing, 3D spreadsheets, chart creation and formula linking across multiple workbooks.

Can develop user defined functions, automate machining processes, including manipulating user interface features, such as menus and toolbars, and working with custom user forms and dialog boxes.

Contact Advanced CNC Solutions for experienced CNC programmers,
email today!



At Advanced CNC Solutions, our mission is to apply our many, many years of real-world CNC programming experience to developing accurate, concise and optimized CNC programs in a timely manner for all customers, saving you both time and money.

Advanced CNC Solutions, a contract CNC programming services provider, has compiled these programming techniques and tips through decades of CNC programming and machining experience.

Below are general programming concepts, tips and suggestions that can be applied to Fanuc, Siemens, Okuma or most any other controller in the CNC machining center or CNC lathe environment. Advanced CNC Solutions implements these concepts and techniques and many others within every program we develop and distribute.


Structured programming ensures programs are more tolerant and forgiving when tools are added or deleted from the NC program. This concept may also protect CNC equipment when a machine operator runs tools or specific cuts out of normal program sequence. Placing redundant modal commands in strategic areas of the CNC program produces more reliable code and is the cornerstone of well-structured CNC code. Structured programming promotes consistency within a given program and from program to program. Structured programming also creates predictability when converting NC programs to a different type of NC controller.

Here is a list of a few suggestions to make a more structured NC program:

At beginning of program:




Provided it’s not a process flow issue, a machine should NEVER crash simply because a programmer or operator changes the order of (or deletes) tools within the program! This happens when modal G-codes and other G, M, F and S-codes were not set properly for EACH specific tool. The concept of modular programming is the mechanism to protect against this problem.

Modular programming forces programs to become far more consistent and forgiving (which protects CNC equipment from damage) when an operator runs tools or specific cuts out of the normal program sequence. Modular programming ensures the correct G-codes, fixture offset, tool length offset, and other word registers are preset if a tool (or even one group of cuts) needs to be re-executed.

A machine operator should be able to run or re-run individual tools out of the normal program sequence without any adverse program effects. Likewise, a programmer or operator should be able to change the order in which tools run (or even delete tools from program) without any adverse program effects (provided the machining process allows this). Modular programming allows this to happen by forcing each tool to have its own set of necessary modal commands and programming attributes like spindle speed, feedrate, and fixture offset. Each tool within a program should be able to fully function on its own (self-contained) without the support of any NC code from any other tool within the program. The big test: if you were to copy and paste any single tool into its own little program, it should run perfectly without any programming issues. This should also be the case even if every modal G-code (and other G, M, F and S-codes) were set in conflict prior to running the single tool program. The single tool program should set ALL NECESSARY modal & non-model codes, allowing it to function properly as a self-contained program. In some cases even individual cuts, like thread milling a single hole, should be designed to function on their own program wise. One good example of this would be an operator may need to re-cut a specific thread milled hole.

Here is a list of suggestions to make a NC program more modular and segmented. These ideas tend to make programs a bit longer (with lots of redundant code), but lack of memory is no longer an issue on most CNC controls.






    These messages aid in program prove-outs and the machine operator’s ability to understand the     program.

N10 G90 G10 L20 P11 X-19.1755 Y-8.1895 Z-42.1303

N20 G90 G10 L20 P12 X-24.6932 Y-25.164 Z-34.1259

N30 G90 G10 L20 P13 X-26.8124 Y-25.164 Z-35.7244



Look for more related information to be added to this page on a regular basis.


Copyright © 2015