What's new
What's new

Macro variables

dcrace

Aluminum
Joined
Jun 26, 2002
Location
U.S.A.
Hello, trying to figure out if there are any "volatile" macro variables that are reset after power down ex: Fanuc #100-#199. There is a morning warmup program I would like to use similar to all of our other Fanuc controlled machines and have it only startup after a power-up in the morning automatically when cycle start is pressed for the first time.

%
O1234(PART PROGRAM)
(PROGRAM COMMENTS)
IF [#100NE1] GOTO 9999
----
----
----
M30
N9999 M98 P0001
M30
%

%
O0001(MORNING WARMUP)
S500 M3
etc....
etc...
#100=1
M1
M99
%
 
Variables

I think that #1 to #33 will reset on power down #100 t0 #199 will be saved and #500 to #699 will be saved Haas book says that #1 to #33 are for Macro call arguments the others I listed are for general purpose
 
If its FANUC, then 100-199 will reset to null after a power cycle. 500-599 will remain after the same power cycle. 1-33 will also reset to null after a power cycle.

Oh... sorry. You want to know if HAAS has the same sameness.... don't know
 
Last edited:
I don't work on Haas..mainly Fanuc so I don't know how much help then hurt I can give you. I do know that Haas works very much like Fanuc so given that:

#1-#33 are your local variables and they will clear at program end and reset. These can be used for the transfer of data through a macro call using A,B,C ect. or just as normal variables when programming.

#100-#199 are your common variables and these will clear at power down, program changes them, or operator via MDI

#500-#999 are your permanent common variables these will never clear until program change or operator via MDI

So using the #1-#33 will not work for your application because at program end or reset the variables will be set to null and it will want to run the warm up. I would have to bet that #500-#999 on a Haas never clear. So this only gives you the #100-#199. You can test this by setting one of these variables with a value and then do a power cycle of the machine and see if the number kept its value or if it cleared to null.

Just out of curiosity are you going to write that statement at the beginning of every program that you have in the control? I would rather have a reference in 1 common program like the tool change program referring to #100 running the warm up so you don’t have to program this in every program
IF[#100NE1]GOTO9999

N9999M98P0001
M30

Stevo
 
dcrace:

#3011 is real time year, month, and day.
#3012 is real time hours, minutes, and seconds.

It is true on HAAS that #100 and up are not cleared on power up.

It appears this machine is a production machine that runs only one program, and you want to prevent an operator error of failing to do the warm up.

You can store #3011 in #100 at the start of your program just after you do the test for "Is this the First Cycle of the Day", IFCD.

In your test for IFCD you compare #3011 with #100. If not equal, then do the warm up.

.
 
Gar,
Just out of curiosity is there a parameter setting that will allow the clearing of #100-#199 at power down? I know there is no parameter setting for the #500-#999 but there is a setting for #100-#199 to clear or not clear at power down for the Fanucs. I was just wondering if it was the same on the Haas.

I do like the date variable. That set up would work pretty well for what he’s looking for. If he is however going to write more programs and have this in the beginning of everyone I would opp to put it in one program like the TC or soemthing of that sort that always runs.

I would like to see the look on the 2nd shifters face if he works past midnight and the machine goes into warm up mode :eek:.

Stevo
 
stevo1:

I am just guessing he is running only one program, or it would be a big a mess to put it at the beginning of every program.

I do not believe you can get Hass to do any programmed action on either power up or down.

Another way to solve this problem is put a delay timer in the cabinet powered from CRM (main power on relay) and the operation of the start pushbutton. Once energized a holding contact would keep the power to the timer until the machine was turned off. The timer might be set at several minutes. This timer output would connect to one of the external inputs. That input would be tested at the beginning of the program. This will cause a warmup sequence anytime the machine power is turned off and back on.

.
 
Gar,
Thanks for the info. I have never run a Haas before I was just curious. Yes I agree that it would be a huge mess to put it in every program that's why I suggested the TC program if he has one and is going to write this into more then one program.

I dont' know of any machines set up to run a "programmed action" at power up. This would be a setting issue for the variables. The Fanuc's don't run a programmed action at power up it is just a loss of the data in these variables when power is shut off. Similar to the machine losing its home position when power is cut. Maybe that’s a bad analogy but my point is it’s not a process, program, or sequence that clears the variables at power down.

I am just really curious on this one. In my books this parameter setting by default is set to clear the #100-#199 variables at power down. This parameter is found under the “Parameters related to custom macro” section, it is bit (CLV).

Anyhow I take your word for it as I stated before I have never dug into a Haas before…just wondering if anyone has come across this setting in their books as I find it odd that this would not be a option as the Fanucs and Haas are very similar on a lot of issues like this.

Stevo
 
I know the new Mazaks (and probably other higher end machines) come with timers and clocks that can start the machine up at a specified time and run the warm up cycle.

I have never seen the Haas do what the original poster is after.

- or as some of you stated, "do extra tasks on power-up".
 
It’s not really a matter of doing extra tasks at power up. It’s a matter of running a calculation line at the beginning of the program. There is nothing new or high end about what Dcrace wants to do. I am sure some new or higher end machines can do this automatically but it is very simple to do with what he has.

His main question is does the variables #100-#199 clear at power down as the Fanucs do via parameter setting bit (CLV) by default these should clear. No one I think has verified via Haas parameter manual to say for sure this is or is not possible.

Now if this is not possible Gar has the perfect solution. At the beginning of Dcrace’s program it will run the warm up. Now at the end of the warm up program he will program #100=#3011. Now #100 is set to the current date. Now for the rest of the day every time he runs the program 1234 at the beginning the code goes IF[#100NE#3011]GOTO999. So #100 is always equal to today’s date so it never runs the warm up program the rest of the day it just bypasses it.

Now the following morning comes (past midnight) they go to run the program and it runs the same equation IF[#100NE#3011]GOTO999. Well #3011 is a new day so #100 and #3011 will not be equal to each other and it will go to N999 run the warm up and at the end of the warm up set #100 equal to the new day.

This should work no problem.

O1234(PART PROGRAM)
(PROGRAM COMMENTS)
IF [#100NE#3011] GOTO 9999
----
----
----
M30
N9999 M98 P0001
M30
%

%
O0001(MORNING WARMUP)
S500 M3
etc....
etc...
#100=#3011
M1
M99

Stevo
 
Sounds like that is what he is after, Stevo, but like you said - won't it run the warm up at 12:01 on the night crew?

I can say, though, that I have never had a problem with any of my guys running the warm up program before starting a part program. I have managed the full range of skilled employee, also.

This is why I mentioned the Mazak warm up - to me it is much more useful, as it performs the warm up before you are there in front of the machine.

BTW - I seriously appreciate your input here. Like I said before, I am fairly new at the macro side, so this is very cool regardless. I suppose you could simply modify your post to put that macro line at the head of every program, and then you would never have to think about it again...
 
You’re more than welcome for the input. I love to share the stuff I have learned over the years macro’s are my fun time. Sounds sick hey.

Yes as I stated it will run the warm up again @12:01 on the night crew. It sounds to me that he does not have a night crew based on saying the “morning warm up”. Anyway that doesn’t mean he never will in the future….then what?? Machine will do a warm up on the night crew. Although if someone were to confirm that there is a way to have #100 clear at power down and he uses that calculation….what happens if there is a power outage or the machine has to be power cycled?? You will have to go through the warm up again. Now this can be avoided both ways by a matter or just changing #100 to either 1 or the current date depending on how you have it set up.

You could put it at the beginning and end of your posts and forget about it but I would rather put it in a program that is locked and never changes and you don’t have to change your post. I can’t speak for Drace but I don’t think it’s a matter of his guys running the warm up or skilled enough to run the warm up. I would do a similar thing just to make it easier or fool proof. I always figure use every bit of the power of that the control offers. I have all sorts of little corks in the macros I write like setting the G43H value, speeds and feeds, tap SF calculations, all this little stuff so the guys don’t have to in the main programs.

Does anyone have a Haas parameter manual that they can check to see if there is a parameter that can be set so #100-#199 clear to null at power cycle? It is in fact Drace’s first question in the original post. Now I am curious if it can be done or not. As I stated it is parameter bit (CLV) in the Fanucs.

Stevo
 
In any of the older machines there is no parameter to change whether #100 etc. are zeroed or not at power up.

I never operate in Fanuc mode on the HAAS mills, I always use HAAS mode. But I do not think Fanuc mode will change what happens on power up relative to #100 etc. However, it has a significant effect on G52.

.
 
Thanks Stevo! Haas finally did e-mail me back and apparently there is no way to have the #100-199 variables clear after power up..... Your idea will work fine as 2nd shift ends at midnight anyways. The main reason I do this for EVERY program run is on another machine, the operator called up the wrong program after running the warmup and well let's just say after paying our service tech almost $15,000.00 to fix what was crashed I decided to make it as foolproof and automatic as I can!

Another thought...Our new Kitamura with 20k spindle will NOT run over about 9k R.P.M. until the spindle is warmed up in the morning, it also has some sort of built-in timer that if it sits idle for more than 4-5 hours it requires the spindle to be warmed up again.... I'm gonna have to do some research to see exactly how that works too.

Thanks again to everyone and their input!
 
dcrace:

#3011 is real time year, month, and day.
#3012 is real time hours, minutes, and seconds.

It is true on HAAS that #100 and up are not cleared on power up.

It appears this machine is a production machine that runs only one program, and you want to prevent an operator error of failing to do the warm up.

You can store #3011 in #100 at the start of your program just after you do the test for "Is this the First Cycle of the Day", IFCD.

In your test for IFCD you compare #3011 with #100. If not equal, then do the warm up..

Dcrace,
You’re more than welcome for the input. The date variable was Gar’s idea.


The main reason I do this for EVERY program run is on another machine, the operator called up the wrong program after running the warmup and well let's just say after paying our service tech almost $15,000.00 to fix what was crashed I decided to make it as foolproof and automatic as I can!

I figured it was something like that. The question is still there as Gar brought up. Is this going into 1 main production program for this particular machine or are you setting this up to post out in every program that you write? If it’s 1 main program then its fine but if this has to go in every program I would suggest sticking this check in the tool change program. This way down the road if you have a different programmer or someone programs something on the fly at the machine this check still takes place.

Stevo
 
TC1999,

I am referring to the tool change macro that you can set up to run with every M6 command. Not all machines are set up with a tool change macro as some tool changes are controlled via ladder logic.

I also don’t think in terms of ‘startup tool change”. I always have a T#M6 command at every operation and point in my programs. I know a lot of people when programming operations that are in sequential order of one another using the same tool will not do the tool change command M6 they just program the G43H#. I have the G43H# programmed into my tool change. And If I am calling the same tool that is in the spindle the tool change is bypassed. Is this what you were refering to weather you had to make sure that a tool change was the first op of the day?

So for the point of putting it in the tool change in my case the tool change macro would be run at every operation and within that program a calculation check will be done for the warm up program.

Stevo
 
I got ya. I also didn't really figure the startup toolchange was necessarily a tool change, since if T1 is in the spindle, it obviously doesn't "change", (but the side mount carousel does re-set).

So - every time the M6 is called, it runs a macro in this example? I am not aware of how you would add a macro to the M6. Is it in the parameters or something? (iow - does it run behind the scenes, so your program looks the same)

Like you, the first thing in every one of my programs has is the tool called out - I would imagine your M6 macro would allow the operator to simply zero the machine in the morning, and hit cycle start (after verifying the correct program), then that first M6 would set the warm-up in motion, and off they go...?
 
Oops! My apologies Gar, I did see your post, but associated the solution to Stevos' due to the written code posted.
In any event, this is setup to output directly from CAM to every posted program, and even some of the the older programs, I will edit before sending them out to the machines. Although most of the parts run since I have been there have been re-CAM'd as the previous programmer I think due to the fact he and the operators got paid by the hour would write code accordingly. One particular part went from 11 minutes and 15 tool changes to about 6 minutes and 9 tools.
 








 
Back
Top