Macro Development Fundamentals Overview
Using MCL (Macro Command Language) to automate aspects of your NC development is a powerful feature, but there is a learning curve. Those familiar with basic principles of computer science will find those same principles apply to macro development. Those unfamiliar with the principles will find that they are not difficult to learn and apply. Also that the principles relate to each other and build on each other, so once the basics are understood, the more advanced principles are merely an extension to existing ideas.
The First Principle
This is the most important concept to understand: The Computer Does What You Tell It To Do.
The computer does not think, analyze, or understand anything. It runs a series of instructions, provided by the programmer, very quickly. That is the extent of a computer's capabilities. Therefore, it is up to the programmer to understand what the goal of the program is and how best to get there. This applies to SmartCAM MCL programming as well. SmartCAM's macro commands offer pre-packaged capabilities that the macro programmer can use; for example, a SmartCAM macro programmer does not have to know how to generate a wall offset profile. However, the macro programmer does need to understand when a wall offset profile is needed and how to write the macro command to generate it.
This means a programmer should always start each program by thinking about the problem being solved. Think about what the solution should be and how SmartCAM will be used to get to the solution. Once the problem is understood and the solution or goal is known, only then should programming start.
There will be a temptation to just jump right in and start to program. This, however, can result in a very messy, hard to understand and hard to maintain program and a lot of frustration and mistakes.
Common Terms
The following is some common terminology that will be used throughout the rest of this tutorial.
- MCL - Stands for SmartCAM Macro Control Language, the SmartCAM scripting language.
- Syntax - this is the structure of the macro language, or how the language is assembled. All languages human or computer have a syntax and syntactic rules.
- Semantic - this is the meaning or intent of the macro statements. These are often referred to as logical errors, the problem being solved was solved incorrectly. In these cases the macro may be syntactically correct, but still not generate the expected results. A semantic error is a true example of the First Principle: The computer does what you tell it to do.
- Debug - to find and fix problems with an MCL file.
Related Topics