Folks, as the title of this thread states.. i want to give you some pointers on macro programming..

i've found that a lot of people run into all kinds of problems, or simply do not know where to start, or how to use the functions available in EdingCNC.

A little introduction first:
I built my CNC machining Center in 2007, but only last year really (sort of) finished it.. because it was spitting out all kinds of parts in the mean time..



This is how my machine looks now..
Don't be intimidated by the very professional looking Control panel.. it's an old Heidenhain TE420 Panel i purchased on the internet

I started working with my machine with ZEUS CNC, and old DOS based CNC control program, very similar to oldfashioned Fanuc's
Putting programs on the machine was tedious to say the least, so i searched for a windows control.. found Mach.. installed it.. didn't like it al all.. found USBCNC ( the old name for EdingCNC) didn't like the layout of the control screens, but loved the posibillities of the software and programming language..

a few weeks after discovering USBCNC, i met Bert Eding on a yearly meeting of a dutch CNC forum, and we discussed the layout of the screens.. because of my experience with professional CNC controls Bert asked me to help him design the new layout he had planned ( it turned out , i was the first with a professional CNC background using USBCNC. )

From then on, i changed my machine from ZEUS to USBCNC, and started testing, also giving Bert Feedback.
One fine day.. i was making some parts with a program that could mill out a rectangular pocket by setting some parameters in the program, Bert called me, and said: "go download the latest version.. i've put in something amazing.. i bet you'll love it".. this was the birth of "Macro.cnc"

The File called "Macro.cnc" contains some subroutines (macro's) for basic tasks such as toolchange and homing, since every machine is different, one could change this file to his personal needs and desires..
If one puts a subroutine in that file, it can be called from MDI, or from a running program.. or.. from the macro file itself, if it is called from another subroutine.

Yes.. Subroutines can be "stacked" upon each other.

Let's make some things clear:
if i talk about a "Macro" that means the total of one or more subroutines working together
If i talk about a subroutine, i only mean one subroutine (everyting between SUB and ENDSUB)

one macro can contain from 1 to a number of subroutines ( subs)

For instance.. if i wanted to make a subroutine that mills out circular pockets ( handy for boltholes with allen bolts), First, i would write a sub with a loop that keeps repeating until final depth is reached..
from that sub, a second sub is called, milling every "layer" out to the desired diameter

Bert went on and made another command possible.. DLGMSG, this stands for Dialog Message, this command enables you to create dialogs for entering values to use in macro's
i first used this on a Lathe i had converted to USBCNC control at work, we used it to machine ballscrews for use in the CNC equippement we built
When machining a ballscrew, i'd touch the tool at the front to the workpiece, and set the Z-value to 1, i then opened a program called "Facing.nc" with a dialog, and i entered : safety distance, starting diameter, finishing diameter,finshing Z coordinate Feed, cutting depth and cutting speed.
Upon hitting Ok, the part was face turned, with the values i had put in..
Next a program "turning.nc" was loaded, and after keying in the right values the part was turned to the desired diameter and length.
A while later Bert introduced the User menu.
this user menu connects a range of F-Keys to subroutines within Macro.cnc.
you can write your macro's into these subs, and put a fitting Icon on the button connected to it.

More to come... stay tuned