CNC Simulator Pro

user guide

10.1. Introduction - Custom Macro B

The Macro programming language in CNC Simulator Pro is inspired by the Fanuc Custom Macro B language. Here we will do a brief presentation of the language. If you are new to parameterized programming, we recommend reading the book "CNC Programming using Fanuc Custom Macro B" by S. K. Sinha (ISBN 978-0-07-171332-0) where you will get in-depth knowledge about the language.

What is Custom Macro B?

It is a high-level computer language. It is more like other computer languages than traditional CNC programming as it offers much more flexibility due to its use of variables, loops, conditions, and calculation capabilities.

A word about safety

Although the Custom Macro language integrated into CNC Simulator Pro is designed to be as compatible as possible with the original Fanuc Custom Macro B language, there may be intentional and unintentional differences between the two due to the variations between a computer program and a physical CNC controller.
It is important to note that CNC programming, particularly Macro programming, can be hazardous, and programming errors can result in serious injury or even death. Therefore, it is your sole responsibility to ensure that the program runs correctly on your machine if you plan to run a program created in the simulator on it. It is not guaranteed that a macro program that works flawlessly in the simulator will function correctly on a real CNC machine, and vice versa.
Please be aware that the creators of the CNC Simulator Pro software and their associates do not assume any responsibility for damages or injuries that may occur as a result of using the software. It is your responsibility to take all necessary safety measures and perform a thorough risk assessment before running any CNC program.

Turn the Macro interpreter on

Before starting to use macro programming in the simulator, you need to turn it on. Go to Settings and activate the Activate Macro interpreter setting.
The reason it is turned off by default is that the interpreter has a slight performance hit and for users not programming in this language, there is no reason to have it turned on.
Please note that Macro programs are limited to run in the 3D view only.