CNC Simulator Pro

user guide

10.5. The macro variables window

We have incorporated an indispensable tool for all macro programmers within the simulator: the macro variables window. This feature serves as a debugging tool that allows you to view and modify variables in real-time, as well as monitor your own expressions. By leveraging this tool in conjunction with the stepping feature of the simulator (including pause points), you can swiftly develop bug-free macro programs.
In addition, the macro variables window is an invaluable tool when learning how macro programming operates. It provides insight into the internal workings of your macro program, allowing you to better understand how variables are utilized and how they interact with the program as a whole.
You open the tool from the View menu.
It is important to note that having the macro variables window open during simulation can significantly slow down the process. This is due to the additional workload placed on the simulator, as it must fetch and update all variables within the window. If simulation speed is a priority, it is recommended to keep the window closed.
At the top, you can see four tabs with pages for different types of variables. The table will show you the variables with their corresponding values, read-only status, and comments.
If you click on a variable in the list, you can edit its value in the panel to the left and click the update button when you are done.
At the bottom of the window, you find the expression watcher panel. By clicking on the green plus icon, you can add your own expressions (or variables only) to keep an eye on them during execution.
We strongly advise you to keep this window open whenever you are writing or editing a macro program. By using the block stepping button, you will be able to follow how variables change during execution, as well as detect logical or mathematical errors much faster and easier.
To understand the different groups of variables, we encourage you to read the book we mentioned in the introduction.