Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

How do I program machine to only run certain parts of the program?


powerfulp
 Share

Recommended Posts

Here's the situation: I have -4- different parts fixtured on a tombstone. Sometimes we don't have all the forgings so we run the same program (the one that machines all -4- parts), even if we only have 2 or 3 of the parts (each fixture runs a different part - four fixtures per tombstone).

 

Question: How do I write the program so I can have the machine run the parts of the program only for the parts that are available? It can be any combination of parts that we may be missing. I didn't want to have to write a bunch of different programs for this.

 

It is for a Mazak FH680 horizontal milling machine with an M+ control. We program in EIA, not mazatrol.

 

Thanks for any help!

Link to comment
Share on other sites

ok i will give you the 101 not knowing all the variables here

 

top of the program have the operator set the number of parts running

 

#100=3 (set number of parts/faces to be run)

#101=0 (set a count for cycle stop)

now have the machine go where it needs in the program

N100 (return block for decision)

IF[#101EQ#100]GOTO5000 (jump to M30 when parts are done)

IF[#100EQ1] GOTO1000 (this sends it to whatever N block you want here it will jump to N1000 1 set of parts/ face of tombstone)

IF[#100EQ2] GOTO2000

IF[#100EQ3] GOTO3000

IF[#100EQ4] GOTO4000

 

 

N1000

code for machining

#101=#101+1 (bump cycle count up by 1)

at the end of a set of parts send it back to the top to see what parts are next to do

GOTO100

 

this is a quick and dirty version without writing a book

there is a number of ways you can do this

HTH

Link to comment
Share on other sites

Great! Thanks for the info - I am going to try this on Monday as see if I can get it to work. I see how the variables work and I think I'm going to try something like this:

 

Assign a variable for each part. 0=no 1=yes such as:

 

#101=0 (Part-1_0=NO 1=YES)

#102=1 (Part-2_0=NO 1=YES)

#103=0 (Part-3_0=NO 1=YES)

#104=1 (Part-4_0=NO 1=YES)

 

Then use the IF/GOTO

 

IF[#101NE1]GOTO21 (If 1st part isn't being run...skip it)

...

...

N21IF[#102NE1]GOTO22 (If 2nd part isn't being run ... )

 

Something like that. I will have to give it more thought, but now at least I have some direction!

 

Thanks again everyone :)

Link to comment
Share on other sites

you are on the right track

once you get into it the sky is the limit on what you can do

one thing i do in my macros is clear all variables at the end of the program so nothing is left in the tables

here is my loop for that

(clear variables from 100-149)

#33=100

WHILE[#33LE149]DO1

#[#33]=#0

#33=#33+1

END1

#33=#0

M30

Link to comment
Share on other sites

Macro's are the bomb-diggity! If you can, pick up a copy of FANUC CNC Custom Macros by Peter Smid.

 

How is your program structure set up now for 4 parts on one tombstone? Do you have a main that calls subs? I think Mazaks use multiple block skips. Could you just do that?

 

%

O100 (MAIN)

G0 G28 BL AH BLA BLA

/M98 P1001 (PART 1)

/2M98 P1002 (PART 2)

/3M98 P1003 (PART 3)

/4M98 P1004 (PART 4)

M30

%

 

So if you only have parts one and four to run, activate block skips /2 and /3. Would that work?

Link to comment
Share on other sites

Here is a tombstone toolpath router that I use (one of several routers). All of my parts have individual on/off switches. This router will work for 1 part per fixture to however many parts are needed. I limit our to 16 parts (128 parts total) due to limited variables.

 

O5034 (14.00 SQUARE TOMBSTONE)

#151=1 (NUMBER OF PARTS PER FIXTURE)

(-0-)
N111 #150=1 (SURFACE 1)
#900=#539+[#151*3]
N112 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5302]GOTO121
IF[#172EQ5303]GOTO131
IF[#172EQ5306]GOTO121
G91 G00 X0 G54 P[#900]
G90 G00 B90.
G201 B90.
G91 G00 X0 G59
M#173 P[#170+1]
GOTO113
END1
N113 IF[#150EQ#151]GOTO121
#150=#150+1
#900=#900+1
GOTO112
N121 #150=1 (SURFACE 2)
#900=#539
N122 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO211
IF[#172EQ5303]GOTO131
IF[#172EQ5304]GOTO131
G91 G00 X0 G54P[#900]
G90 G00 B0.
M#173 P[#170+2]
GOTO123
END1
N123 IF[#150EQ#151]GOTO131
#150=#150+1
#900=#900+1
GOTO122
N131 #150=1 (SURFACE 3)
#900=#539+#151
N132 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO211
IF[#172EQ5302]GOTO221
IF[#172EQ5305]GOTO211
G91 G00 X0 G54 P[#900]
G90 G00 B270.
G201 B270.
G91 G00 X0 G59
M#173 P[#170+3]
GOTO133
END1
N133 IF[#150EQ#151]GOTO211
#150=#150+1
#900=#900+1
GOTO132
(-90-)
N211 #150=1 (SURFACE 1)
#900=#539
N212 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5302]GOTO221
IF[#172EQ5303]GOTO231
IF[#172EQ5306]GOTO221
G91 G00 X0 G54 P[#900]
G90 G00 B90.
G201 B90.
G91 G00 X0 G59
M#173 P[#170+1]
GOTO213
END1
N213 IF[#150EQ#151]GOTO221
#150=#150+1
#900=#900+1
GOTO212
N221 #150=1 (SURFACE 2)
#900=#539+#151
N222 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO311
IF[#172EQ5303]GOTO231
IF[#172EQ5304]GOTO231
G91 G00 X0 G54P[#900]
G90 G00 B0.
M#173 P[#170+2]
GOTO223
END1
N223 IF[#150EQ#151]GOTO231
#150=#150+1
#900=#900+1
GOTO222
N231 #150=1 (SURFACE 3)
#900=#539+[#151*2]
N232 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO311
IF[#172EQ5302]GOTO321
IF[#172EQ5305]GOTO311
G91 G00 X0 G54 P[#900]
G90 G00 B270.
G201 B270.
G91 G00 X0 G59
M#173 P[#170+3]
GOTO233
END1
N233 IF[#150EQ#151]GOTO311
#150=#150+1
#900=#900+1
GOTO232
(-180-)
N311 #150=1 (SURFACE 1)
#900=#539+#151
N312 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5302]GOTO321
IF[#172EQ5303]GOTO331
IF[#172EQ5306]GOTO321
G91 G00 X0 G54 P[#900]
G90 G00 B90.
G201 B90.
G91 G00 X0 G59
M#173 P[#170+1]
GOTO313
END1
N313 IF[#150EQ#151]GOTO321
#150=#150+1
#900=#900+1
GOTO312
N321 #150=1 (SURFACE 2)
#900=#539+[#151*2]
N322 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO411
IF[#172EQ5303]GOTO331
IF[#172EQ5304]GOTO331
G91 G00 X0 G54P[#900]
G90 G00 B0.
M#173 P[#170+2]
GOTO323
END1
N323 IF[#150EQ#151]GOTO331
#150=#150+1
#900=#900+1
GOTO322
N331 #150=1 (SURFACE 3)
#900=#539+[#151*3]
N332 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO411
IF[#172EQ5302]GOTO421
IF[#172EQ5305]GOTO411
G91 G00 X0 G54 P[#900]
G90 G00 B270.
G201 B270.
G91 G00 X0 G59
M#173 P[#170+3]
GOTO333
END1
N333 IF[#150EQ#151]GOTO411
#150=#150+1
#900=#900+1
GOTO332
(-270-)
N411 #150=1 (SURFACE 1)
#900=#539+[#151*2]
N412 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5302]GOTO421
IF[#172EQ5303]GOTO431
IF[#172EQ5306]GOTO421
G91 G00 X0 G54 P[#900]
G90 G00 B90.
G201 B90.
G91 G00 X0 G59
M#173 P[#170+1]
GOTO413
END1
N413 IF[#150EQ#151]GOTO421
#150=#150+1
#900=#900+1
GOTO412
N421 #150=1 (SURFACE 2)
#900=#539+[#151*3]
N422 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO501
IF[#172EQ5303]GOTO431
IF[#172EQ5304]GOTO431
G91 G00 X0 G54P[#900]
G90 G00 B0.
M#173 P[#170+2]
GOTO423
END1
N423 IF[#150EQ#151]GOTO431
#150=#150+1
#900=#900+1
GOTO422
N431 #150=1 (SURFACE 3)
#900=#539
N432 WHILE[#[#900+600]EQ1]DO1
IF[#172EQ5301]GOTO501
IF[#172EQ5302]GOTO501
IF[#172EQ5305]GOTO501
G91 G00 X0 G54 P[#900]
G90 G00 B270.
G201 B270.
G91 G00 X0 G59
M#173 P[#170+3]
GOTO433
END1
N433 IF[#150EQ#151]GOTO501
#150=#150+1
#900=#900+1
GOTO432
N501
M99

Link to comment
Share on other sites

Here is what I have done. In the individual programs I replace all work offsets with G#500. I then create a master program that looks something like this:

 

G#500=54

M98 P1

M1

G#500=55

M98 P2

M1

G#500=56

M98 P3

...

 

Works really well and it is very quick to change work offsets and move parts around in different fixtures, etc... Dropping a program from the routine is as easy as adding a block delete command before the M98, or deleting the line entirely. I have also used this method with G10 commands with great results

Link to comment
Share on other sites

Ok, I have my program set-up and I am getting an alarm (806 Illegal Address). Does anyone see anything wrong with this line for a Mazak M+ control? :

 

IF[#157EQ1]THEN#800=1

 

I'm not familiar with Mazak, but is it capable of reading both EQ and = ?

Maybe you need spaces?

Link to comment
Share on other sites

i dont know mazak

will your machine handle the "then" statement?

 

plus watch out for the look ahead, are you sure this is the line it is alarming out on?

put 3 EOB before each statement so you can single block thru it and see what line is giving the alarm

 

i have used this format on a fanuc

IF[#100EQ1]THEN#103=1000

IF[#101GT1]THEN#102=[#102+#103]

Link to comment
Share on other sites

will your machine handle the "then" statement?

 

 

Your problem is with the THEN. MAZAK controls do not work with the THEN command. We have Mazak a few machines with various controls and none of them accepts this command

 

well that answers that question

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...