I’ve used subs alot in the past on fanuc and just recently discovered m97, local sub routine, and I wanna incorporate these on a mazak lathe so I can program a broach operation in g code that I can edit the geometry of and call it up when needed then call back to the next unit in mazatrol. Was going to loop in incremental and change the typical variables based on prints. My coworker was showing me his broaching job and had 135 lines of manual program in his mazatrol, and I’m thinking I can do that in 15 lines in g code.
@akman1947 Oh, I understand now. We have an older mazak lathe in the shop, but unfortunately, I only have limited experience on it, so I do apologize for not being much help.
best explanation out there. and ive just watched dozens. question. where does one save the subprogram? say one has a 30 year old machine that takes floppies and youre trying to make multiple parts but only enough memory for one parts code? if i have my sub on the floppy will it look to the floppy drive with the P command?
So I don't believe it will be able to read from the floppy. However, if there is a way to remove items from your post on the program such as N lines like N10 this will help with the size. The subprogram must be inside the program using m97 or a has to be in the machines directory that uses m98. Some machines can not use m97, so M98, maybe your only option. I'm glad you like the video I hope you get this working.
Thanks@@aaronrunk4209 Ok so I tried it just for fun and it worked...kind of. I have a miltronics vm17 with centurion 6 control. using a compact disc reader. I put both my main program on the compact disk and my sub program and loaded them into my control. using G54 X0Y0 M98 P2000 for part one it looped to the sub program and then G55 X0Y0 M98 P2000 for part two looped to the sub program. everything feeds through just fine but im stuck looping the the second part over and over. should i delete my end code and just throw an M30 in there? heres the code
@DirtKickersandArrowheadLickers well I am glad to hear that it is reading from the compact discs however if you remove the m99 and put the m30 on there it will only reset to the top of your program and you will have to hit cycle start again. If you have a first and second program, you will need to rename the second program with a different P. Example op1 G54 X0Y0 P1000 and op2 G55 X0Y0 P2000. Be sure your op1 is named O1000, and op2 is O2000. It sounds like you're heading down the right path machines are finicky and finding out exactly what they like is half the battle
Hi and thank you for watching the video. Good news is yes you can have a program search for a specific starting point. If you noticed in the video I have the command GOTO2 this goes to N2 if it was GOTO4 it would skip to N4 and only run the last hole. However, if you are wanting to skip to a specific line in the Sub program you would need to open the sub program so that you can edit it and you would put a GOTO in the actual sub program. This would stay active until you edited back to it original form, but it will skip to the "N" point in the sub program that you are needing to start at. Good Luck and I hope this helps.
@@aaronrunk4209 Thanks for the quick reply. That may not work for my situation, but I'll give it a try. I was hoping to find a solution where I didn't have to edit the sub.
I have a qurstion, running parts, most of program is in G99, (No face g IE CS and spindle lock, no G50), but later in the program they are using G 97, so I'm confused wgy, im sure there is no G 96 and the parts don't have radically different I'd profiles to just fit G96, so yea ?
Good news is a G99 works close to what a G96 does except just like on a manual lathe you can set your FPR and it will work even if you have different sizes in OD or ID. However, is your part has a call out for a specific surface finish the program would need adjusting either in the spindle speed or Feed rate itself. It's a different way of running the machine but if it works! Thank you again for watching
The end of the sub program will be an M99 that will then resume the original program. The L at the end of the M97 or M98 line will be the number of times you want the sub program to repeat. I hope I answered this correctly, but if not, let me know, and I can post the code in the comments. Thank you for watching
I did use macros when I worked on a CNC 5 axis in Industry however the only time I show students how to use macros is when I pull up the program I used to use and show them how to adjust it while it's running.
Very well explained. I've been trying to figure this out for a while.
You're welcome. It's such a great feature to programming but it has to be just right or the machine's get picky fast. Thank you for watching
I’ve used subs alot in the past on fanuc and just recently discovered m97, local sub routine, and I wanna incorporate these on a mazak lathe so I can program a broach operation in g code that I can edit the geometry of and call it up when needed then call back to the next unit in mazatrol. Was going to loop in incremental and change the typical variables based on prints.
My coworker was showing me his broaching job and had 135 lines of manual program in his mazatrol, and I’m thinking I can do that in 15 lines in g code.
That's very cool and a good use of the code. That loop function is the game changer for me. Thanks for watching
@@aaronrunk4209 i just have no Idea how to do it in mazatrol
@akman1947 Oh, I understand now. We have an older mazak lathe in the shop, but unfortunately, I only have limited experience on it, so I do apologize for not being much help.
best explanation out there. and ive just watched dozens. question. where does one save the subprogram? say one has a 30 year old machine that takes floppies and youre trying to make multiple parts but only enough memory for one parts code? if i have my sub on the floppy will it look to the floppy drive with the P command?
So I don't believe it will be able to read from the floppy. However, if there is a way to remove items from your post on the program such as N lines like N10 this will help with the size. The subprogram must be inside the program using m97 or a has to be in the machines directory that uses m98. Some machines can not use m97, so M98, maybe your only option. I'm glad you like the video I hope you get this working.
Thanks@@aaronrunk4209 Ok so I tried it just for fun and it worked...kind of. I have a miltronics vm17 with centurion 6 control. using a compact disc reader. I put both my main program on the compact disk and my sub program and loaded them into my control. using G54 X0Y0 M98 P2000 for part one it looped to the sub program and then G55 X0Y0 M98 P2000 for part two looped to the sub program. everything feeds through just fine but im stuck looping the the second part over and over. should i delete my end code and just throw an M30 in there? heres the code
@DirtKickersandArrowheadLickers well I am glad to hear that it is reading from the compact discs however if you remove the m99 and put the m30 on there it will only reset to the top of your program and you will have to hit cycle start again. If you have a first and second program, you will need to rename the second program with a different P.
Example op1 G54 X0Y0 P1000 and op2 G55 X0Y0 P2000. Be sure your op1 is named O1000, and op2 is O2000. It sounds like you're heading down the right path machines are finicky and finding out exactly what they like is half the battle
what's up Toretto?
Is there a way to use M98 and have the machine go to a specific line # in the sub? I have an older Haas VF1.
Hi and thank you for watching the video. Good news is yes you can have a program search for a specific starting point. If you noticed in the video I have the command GOTO2 this goes to N2 if it was GOTO4 it would skip to N4 and only run the last hole. However, if you are wanting to skip to a specific line in the Sub program you would need to open the sub program so that you can edit it and you would put a GOTO in the actual sub program. This would stay active until you edited back to it original form, but it will skip to the "N" point in the sub program that you are needing to start at. Good Luck and I hope this helps.
@@aaronrunk4209 Thanks for the quick reply. That may not work for my situation, but I'll give it a try. I was hoping to find a solution where I didn't have to edit the sub.
I have a qurstion, running parts, most of program is in G99, (No face g IE CS and spindle lock, no G50), but later in the program they are using G 97, so I'm confused wgy, im sure there is no G 96 and the parts don't have radically different I'd profiles to just fit G96, so yea ?
Good news is a G99 works close to what a G96 does except just like on a manual lathe you can set your FPR and it will work even if you have different sizes in OD or ID. However, is your part has a call out for a specific surface finish the program would need adjusting either in the spindle speed or Feed rate itself. It's a different way of running the machine but if it works! Thank you again for watching
did that say ZL at the end of your sub program? if so can you explain?
The end of the sub program will be an M99 that will then resume the original program. The L at the end of the M97 or M98 line will be the number of times you want the sub program to repeat. I hope I answered this correctly, but if not, let me know, and I can post the code in the comments. Thank you for watching
❤do you use macro???😊
I did use macros when I worked on a CNC 5 axis in Industry however the only time I show students how to use macros is when I pull up the program I used to use and show them how to adjust it while it's running.
Macro program not work haas tm1??
Pls explan haas macro?
I don't know enough about macro programming to lecture on it. I do apologize but you'll have to keep looking
I cant see the notes for m97 like m98. your in front of it
Hello, and thank you for watching. Below is the code I use in the video. Hope this helps. %
O0454
M01
(.750 ENDMILL .750 LOC 1.0 LFH)
(CRC = D02)
N40 G00 G17 G20 G40
N45 T2 M06
N50 G54 G90 X-0.5 Y0 S5000 M03
N55 G43 H02 Z1. M08
N60 Z-0.1
M97 P123 L30
G00 G91 Z0
M30
N123
G91
G01 X1. F100.
G03 X-1. R0.5
G01 Y0.05
M99
%