Home ] Up ] News ] Related Sites ] FAQ ] Feedback ] Contents ] Search Page ]

What is a Macro?

 

Home
Up


Most CNC controls have an optional feature known as Custom Macro B or User Macro. This a powerful programming language that allows programs to be written using variables instead of fixed numbers. The language includes structures for conditional and unconditional program branching, repetitive looping and mathematical equations.

It's Like Having BASIC Built into Your Control
Custom Macro is similar to the BASIC language on a PC, but don't worry if you've never written a BASIC program.  With the Programming Unlimited manual you will learn everything you need to be comfortable with Custom Macro.

Custom Macro is used along with the standard "G" codes to enhance your flexibility when programming. With Custom Macro, you are no longer limited to writing a fixed tool path program. You can use mathematical and trigonometric functions to calculate end points. This makes family of part or complex shape programming possible. For example, if you needed to program a parabolic shape, Custom Macro is the obvious choice. You would write a loop that calculates the new end point for each axis and the program would do the rest.

Not Just Tool Paths
But Custom Macro is not limited to tool path generation. The real power of Custom Macro is that it allows you to interact with the machine. For example, you can write a program that updates the coordinate system automatically or opens the RS232C port and outputs data while the program is running. If you want to add automatic clamping or inspection probes, you need to understand Custom Macro.

With a Custom Macro program, the instructions are written using variables and these variables can be changed each time the program is called. For example, if a program is stored in memory to drill a bolt circle, that program can be used with any main program to drill any size or pattern bolt circle. All that is required is for different variables to be defined when the sub program (macro) is called. To see an example of a custom macro program click one of the example links at the top of this page. You can also checkout our Tips and Tricks page to see examples of Custom Macro in action.

All of our products carry a thirty day - No Questions Asked - return policy!

 

Home ] Up ]

Send mail to webmaster@programmingunlimited.com with questions or comments about this web site.
Copyright © 2007 Programming Unlimited
Last modified: February 17, 2008