Today, Mark shows you how to create your own custom M & G codes. If you have repetitive, monotonous, hand programming routines that you perform every day, Mark shows you how to create a custom program, and alias (reference) it with a single M or G code! Don't miss any "TIP OF THE DAY" videos. Click here (http://haascnc.com/subscribe_include.asp) to join our email list!
This video explains how to create custom alias G and M codes on Haas machines, allowing users to assign complex sequences of commands to a single, simple code to improve efficiency and simplify repetitive tasks.
My name is Mark and I'd like to welcome you to this Haas Tip of the Day.
Now if you could create your own g-code to do almost anything, what would you have it do?
Maybe you'd write your own custom tool change cycle to avoid the trunning on your machine.
Or maybe you'd write a custom code that probes the angle on a part and writes that angle to a
work offset. Well today's tip is going to help lay the groundwork to do exactly that. Create your own
alias G&M codes.
Every time I walk up to my UMC, the table is full of coolant. I blow it off and get drenched.
This happens over and over. Okay, I know what code we're going to create today.
When we run this code, the control is going to tip the rotary axes on my UMC and drain the coolant
from my part. Now this will keep me from getting soaked every time I reach in and hose the coolant
off. Now this is just an example. You could write almost any kind of program and assign it to almost
any G&M code. Any code that you find yourself entering over and over again can be turned into
a simple alias G&M code. Let's see how this works. Now we're going to be editing a 9000 program,
so we have to turn setting 23 edit lock off. And because we're also going to be changing a
parameter, we have to turn setting 7 parameter lock off as well. Parameters 81 through 100
contain our alias code information. So I'm going to go to parameters, enter 90 and press down arrow.
This brings me to parameter 90, M macro call 9009. Right now it's set to zero. I'm going to set that
to 155. It says servo is on. That just means I have to press E stop. We'll try that again.
And it took it. Now parameter 90, M macro call 09009 is set to 155. What this means is that
anytime I command an M155 from within my program or from MDI, control is going to run subprogram
9009. Now why did I choose 155? You have to be careful with this. If I choose an M code or a G
code that already exists, the control is going to use my M6 instead of the control's M6.
There isn't an M155, so we're safe in this case. Okay, let's take a look at my 9009 program.
There's nothing really special about it. It moves my tool up and out of the way and rotates the
axes. It's worth noting that last line, though. It contains an M99, not an M30. With the M99,
this subprogram returns to the main program when called. Let's close the doors, and I'm going to
command an M155 from MDI and press cycle start. My tool goes up and out of the way. My rotary
tilts over and drains, and my program actually waits for me to press cycle start so the rotary
can return back to B and C0. Now there are some differences between alias G codes and alias M
codes. An alias G can transfer macro variables, which means that the macro option needs to be
enabled. With an alias M code, you don't need the macro option. Now on our next gen control,
NGC, things are slightly different when setting up an alias G or M code. There are really just
two differences. One is that our alias M and G code information is not stored under parameters.
It's stored on the alias codes tab when we press settings. The second thing is that our 9009
program is now stored in a folder called O9000 under Lisprog. Okay, so the NGC is pretty simple.
Well, that's about it. For the programs that we used today, be sure to check out the link at the
end of this video for today's bonus content. Thanks for letting us be a part of your success
and for watching this Haas Tip of the Day.