What's new
What's new

macro for mazak machine

sc1smith

Plastic
Joined
Aug 23, 2018
can anyone please tell me what this macro does, a coworker has put it on our machines and we have started to have tool crashes was just wondering if this is the cause, he won't tell anyone what it does.

8633(Clear Local Variables)
( Last Edit: 09/03/2016 )
(CLEARS LOCAL VARIABLES 1 thru 33 on Levels 0-4)

IF[#2NE#0]GOTO2
#2=4 (1st run)
G65P8633B#2
GOTO9
N2 (not 1st run)
#2=#2-1
WHILE[#2GT0]DO10 (limit level)
G65P8633B#2 (recurse here)
#1=34
WHILE[#1GT1]DO20 (clear one level)
#1=#1-1 (next var)
#[#1]=#0 (clr)
END20
#2=#0
M99 (end recurse)
END10
#2=#0
M99
N9
#2=#0
M30 (f81 11h
 
can anyone please tell me what this macro does, a coworker has put it on our machines and we have started to have tool crashes was just wondering if this is the cause, he won't tell anyone what it does.

8633(Clear Local Variables)
( Last Edit: 09/03/2016 )
(CLEARS LOCAL VARIABLES 1 thru 33 on Levels 0-4)

IF[#2NE#0]GOTO2
#2=4 (1st run)
G65P8633B#2
GOTO9
N2 (not 1st run)
#2=#2-1
WHILE[#2GT0]DO10 (limit level)
G65P8633B#2 (recurse here)
#1=34
WHILE[#1GT1]DO20 (clear one level)
#1=#1-1 (next var)
#[#1]=#0 (clr)
END20
#2=#0
M99 (end recurse)
END10
#2=#0
M99
N9
#2=#0
M30 (f81 11h

Hello sc1smith,
It initializes Local Variables to Vacant (#0) to the extent of Level 0 to 4. This Macro would not cause the problem you're having. Depending on Parameter setting, Pressing Reset would achieve the same result, as would executing M30, which is Linked to the Reset Signal, as would cycling the power to the control.

When you say Tool Crashes, I assume you mean crash into the work, work holding etc. For this Macro to have any effect, it would have to be executed. Accordingly, if it was causing your issue it would have to be executed prior to running a program, or Tool Operation within the program. As explained above, the status of the Local Variables #1 to #33, would be the same when the control is first turned on, as when after executing the Macro.

Still assuming that Tool Crashes refers to crashing the tool into the work, or machine, look to Program, Offset, or Operator error for the cause.

Regards,

Bill
 
Last edited:
thank you for the comment Bill

what would the reason be for running this macro

and if you don't mind here is another one that he runs

O8730(Tool Data Print)
( Last Edit: 04/11/2018 )
(Exports current work offsets )
( & tool offsets to shared log file. )
( It takes about 10-20 seconds. )
( Do not <single block>. )

#3=30 (C=mag capacity 30 or 48)
#33 = #3012/100.
POPEN
DPRNT Date*#3011[80]**Time*#33[40]**Part*Number**#3901[30]
DPRNT SHIFT*X#5201[35]**Y#5202[35]**Z#5203[35]
DPRNT G54*X#5221[35]**Y#5222[35]**Z#5223[35]
DPRNT G55*X#5241[35]**Y#5242[35]**Z#5243[35]
DPRNT G56*X#5261[35]**Y#5262[35]**Z#5263[35]
DPRNT G57*X#5281[35]**Y#5282[35]**Z#5283[35]
DPRNT G58*X#5301[35]**Y#5302[35]**Z#5303[35]
DPRNT G59*X#5321[35]**Y#5322[35]**Z#5323[35]

#30=1
DPRNT
WHILE [#30LE#3]DO1
DPRNT T#30[20]*L#[60000+#30][35]**Z#[11000+#30][35]**R#[17000+#30][35]
#30=#30+1
END1
DPRNT TSetter*v520*#520[35]**v521*#521[35]
PCLOS
M30
(f81 11h)
 
thank you for the comment Bill

what would the reason be for running this macro

and if you don't mind here is another one that he runs

O8730(Tool Data Print)
( Last Edit: 04/11/2018 )
(Exports current work offsets )
( & tool offsets to shared log file. )
( It takes about 10-20 seconds. )
( Do not <single block>. )

#3=30 (C=mag capacity 30 or 48)
#33 = #3012/100.
POPEN
DPRNT Date*#3011[80]**Time*#33[40]**Part*Number**#3901[30]
DPRNT SHIFT*X#5201[35]**Y#5202[35]**Z#5203[35]
DPRNT G54*X#5221[35]**Y#5222[35]**Z#5223[35]
DPRNT G55*X#5241[35]**Y#5242[35]**Z#5243[35]
DPRNT G56*X#5261[35]**Y#5262[35]**Z#5263[35]
DPRNT G57*X#5281[35]**Y#5282[35]**Z#5283[35]
DPRNT G58*X#5301[35]**Y#5302[35]**Z#5303[35]
DPRNT G59*X#5321[35]**Y#5322[35]**Z#5323[35]

#30=1
DPRNT
WHILE [#30LE#3]DO1
DPRNT T#30[20]*L#[60000+#30][35]**Z#[11000+#30][35]**R#[17000+#30][35]
#30=#30+1
END1
DPRNT TSetter*v520*#520[35]**v521*#521[35]
PCLOS
M30
(f81 11h)

Hello sc1smith,
There is no real point to running the Macro in your first Post unless in conjunction with other programs where there may be some necessity to initialize all Local Variables for nested Macros between their recursive calls. In my mind it would be a rather special application, rather than a tool that will be of benefit every time one writes a Macro program.

The Macro in your last Post simply transfers the Current Tool Offsets via the Serial Port. You would require an External Device (Computer) to be ready and running software to accept the data.

I can see this program only being useful if you needed to programmatically upload the Offset during the execution of a program, simply because nearly the same can be achieved via Edit Mode (and no special Macro). One advantage of this Macro over simply transferring the data via Edit Mode, is that the data is being output in a particular Format (useful when reviewing the Offset Data).

Regards,

Bill
 
It looks like it exports and saves Offset, and Work Offsets in a separate file. So if you use the exact same setup, you just apply the stored information to that job. No need to touch off all the Tools again.

Robert.

Yeah, what Bill said
 
It looks like it exports and saves Offset, and Work Offsets in a separate file. So if you use the exact same setup, you just apply the stored information to that job. No need to touch off all the Tools again.

Robert.

Yeah, what Bill said
Hello Rob,
The disadvantage with this Macro, if the intent was to use the same Offset Data next time the program is run, is that the Format is wrong for reloading the Offsets. It would be better to Output the data so that G10 could be used, or simply a date (in brackets) and raw Offset Data in the form that can be transferred directly to the control.

Regards,

Bill
 
Hello Rob,
The disadvantage with this Macro, if the intent was to use the same Offset Data next time the program is run, is that the Format is wrong for reloading the Offsets. It would be better to Output the data so that G10 could be used, or simply a date (in brackets) and raw Offset Data in the form that can be transferred directly to the control.

Regards,

Bill

Agreed. I didn't think about the re-loading when I posted.

Sort of seems like the operator is securing his knowledge base, and his job too. But I know half of nothing.

R
 








 
Back
Top