What's new
What's new

M98 Programming - multiple similar parts

TropoPV

Plastic
Joined
Sep 9, 2012
Location
Grand Rapids
I've been tasked with programming a family of parts that are all very similar on our VF2. I'm considering making a base program and using M98 to call up sub-programs for the various different styles and using block delete on the sub-programs that aren't needed for the part. I haven't done something like this before so I'm wondering if the plan I have will even work at all.

O12310
(BASE PROGRAM)
[prep code]

(OP1)
/M98 P12311
/M98 P12312
/M98 P12313
/M98 P12314
M99 PNnn

(OP2)
/M98 P12320
/M98 P12321
/M98 P12322
/M98 P12323
/M98 P12324
/M98 P12325
/M98 P12326
/M98 P12327
/M98 P12328
/M98 P12329
M99 PNnn

(OP3)
/M98 P12331
/M98 P12332
/M99 Nnn

[end of program code]

So whatcha think? Am I headed in the right direction or totally off base? Thanks :)
 
Are you trying to run all the programs? Like the op2 and op3? if so, are those M99's going to end your program, or loop it? But I do something similar in our horizontals and verticals. I would add in between the m98 call outs, if you have more blockskips a "/2 M0" so you can stop the program from job to job. I hate when proofing new programs when the machine takes off to a new program with out me confirming the machine clears everything.
 
Are you trying to run all the programs? Like the op2 and op3? if so, are those M99's going to end your program, or loop it? But I do something similar in our horizontals and verticals. I would add in between the m98 call outs, if you have more blockskips a "/2 M0" so you can stop the program from job to job. I hate when proofing new programs when the machine takes off to a new program with out me confirming the machine clears everything.

The Haas Mcode reference says "An M99 Pnn will jump the program to the corresponding Nnn in the program."

The example code they give is:

O0001 ;
...
N50 M98 P2 ;
N51 M99 P100 ;
...
N100 (continue here) ;
...
M30 ;

subroutine: O0002 ;
...
M99 ;


So if I understand it correctly, The M98 P2 calls program O00002. Program O00002 runs until it reaches the M99 in that program which sends it back to the original program. Then the M99 P100 skips the original program to N100 and continues from there.

My plan is to be able to select which Op1 I want and which Op2 I want and skip all the rest. Op1 and Op2 always go together in some combination, but Op3 is rare which is why I added a block delete to its M99. I'll definitely be adding M00 between operations, because the parts have to be flipped or put into another vise.
 
an M99 with a P is not an end of subroutine, but just a program jump. (same as on Fanuc)

I would suggest using M97 instead. That way all your subroutines are contained in one file.
 
the more complicated you get with it the more chance of error. I would maybe have a different base program for each part this way once its set you should be good to go
 
I ran a simple set of test programs last night using the base code in my first post and it worked exactly as I intended...which is a nice change of pace from my normal learning curve :P. All of the parts have the same base dimensions, and use the same G54 and fixture, they just have different features on one face. The programs are generated by Inventor HSM, so I'm not too worried about errors there, plus I'll test run each program before trying to run them from the base program. These are "as ordered" products and we do a large number of each iteration throughout the year.

I want to have individual programs because it is sometimes necessary to run a specific Op on some pieces and I'd like to be able to easily edit the Ops as needed with HSM.

Here are a few of the variations:

2014-05-19-at-16-18-28-300x300.jpg


2014-05-19-at-16-03-31-300x300.jpg


usb-stand-tag-300x300.jpg



The company I work for (The Geek Group) does Youtube videos in a big way, so if we end up doing blog or production video on this program, I'll post it here. Thanks for the input all :)
 
Guess I'd do it with macro variables. Never done macros on Haas, but on Fanuc...

#1=? (Op 1, 1=three holes, 2=two slots and one hole, 3=...) (enter number at question mark)
#2=? (Op 2, .....)
#3=? (Op 3, .....)

(Do common part features here, call common part subroutines, etc)

IF #1LT1 GOTO "error check" code

IF #1GT1 GOTO 10
Do whatever 1s Op 1 is, call revelant subroutines etc...
GOTO 100

N10 IF #1GT2 GOTO 20
Do whatever 1st Op 2 is...
GOTO 100
.
.
.
N100 IF #2GT1 GOTO 110
Do whatever 2nd op 1 is...
GOTO 200

N110 IF #2GT2 GOTO 120
Do whatever 2nd Op 2 is...
GOTO 200
.
.
.
N200 IF #3GT1 GOTO 210
Do whatever 3rd Op 1 is...
GOTO N1000

N210 IF #3GT2 GOTO 220
Do whatever 3rd Op 2is...
GOTO N1000
.
.
.
N1000 (end of program code)
M30

I'm still new at macro variables, but they are very powerful for family of parts. You can get a certain kind of part complete, simply by changing what you assign to that macro variables at the top of the program. I've seen them on my Haas in the probing functions, but never tried to program them myself. Format may be different.

For more information, check out the Macro Programming Fundamentals "sticky" in the CNC forum...

Good luck!
Eric U
 








 
Back
Top