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:

Program# Sequence


Metal_Eater
 Share

Recommended Posts

Is there any way to output sequential program# like O0001, O0002, O0003 automatically without manually editing the program# in mastercam.

 

%

O0001(TOP)

(FILE - \\HAASVF4\DATA\14441\TOP\)

 

DATE=12-06-13 TIME=09:05)

(T1 | 1/4 FLAT ENDMILL)

 

Can it be automated in post?:

*progno$, "(",sprogname$,")", e$

 

Thanks

Link to comment
Share on other sites

That would require for MCAM to know which program # was used prior to, I don't think that's possible. What if you are reposting a file, this might prove ineffective as MCAM will not now this. You can however setup your post to prompt, you at the time you are writing the NC code, for the program # and whether it is a repost. Is it that much of a hassle to change the program number or set it in MCAM ?

 

GM

Link to comment
Share on other sites

I would think this would probably be possible with a bit of post magic.. mixed with how you make your files in mastercam

 

In mastercam have your main ie first program numbered how you want.. then make every other program numbered 9999

 

Make the post write to a file buffer the program number so long as its not 9999

 

Make the post look for a program number of 9999 if its 9999 read the number from the file buffer and output to nc and increment the number by one ane write it back to the file buffer

 

Then all your programs will be named incrementally one more then your original.. this depends on the buffer file not dissapearing after posting one nc file which I havent tested though..

Link to comment
Share on other sites

How are those 20-30 NC file organized? Are you trying to post out each operation as a separate NC file (and sequential program number), or do you have multiple Toolpath groups that have multiple operations?

 

Since the Program Number (O0001, O0002, O0003, ...) is tied to a Machine Group, you could load multiple Machine Groups into your Mastercam file, set the Program Number for each Machine Group, and then set the NC File Name.

 

Otherwise you'll need some kind of Post customization, and some way to flag that to let the Post Processor know. (Misc Integer, Misc Real Number).

Link to comment
Share on other sites

The programs are created under same machine group and each program is posted as separate NC file. These are mostly mold cavity shape machining plus cavity# programs like 01-30 engraved on 3d surface in same setup. Ideally Mastercam should automatically increment program# 1, 2, 3, 4....automatically when we change the "NC File Name" instead of going thru the programs twice once to change NC file name & then to change program#, just a suggestion.

Link to comment
Share on other sites

Hello Metal_Eater,

 

I spoke with some of our Developers here, and doing the auto-increment for the program number isn't really feasible.

 

When you set a 'NC File Name', this groups together operations that will be posted into a single file. The NCI file is generated based the operations having a common name. When the files are post processed, each NCI file is processed independently. MP (the post engine) is not "aware" of how many NCI files you are processing, so we would have to add (and test) a lot of code to get this to work.

 

The solution for your needs will be to add a new Machine Group for each unique program you wish to output. In the Machine Group Properties, you can set the NC Program number, and set the NC File Name for all the operations in your Machine Group. Mastercam is not limited in the number of Machine Groups you can add to the interface, so you will be able to have a set of NC Operations that have a unique NC File Name and Program number. This will save you the aggravation of having to change the program number for each unique NC File Name, but this will work without having to modify anything in the Mastercam interface.

 

Thanks,

 

Colin

Link to comment
Share on other sites

Colin, when you select a number of operations and right-click and choose "Edit selected operations>>>Change program #" where is that changing that value? I don't completely understand how software programming works, but you can set a value for each toolpath group to output a different program number for each group. So my OP-1 toolpath group posts out as program O00001, and OP-2 toolpath group as O00002. But I have to manually change these values for all the operations within the group, or before I start generating operations in a group I set the program number on the Tool Settings in the Parameters section. Then the appropriate program number is already used for each operation created thereafter until I change the number again..

 

So I guess I just don't understand what you are saying about that being handled in the post engine.

 

Why couldn't a setting be added in the configuration in the Toolpath Manager section to sequence the program number the same as the toolpath group? This has always bugged me about Mastercam. I post out 7 programs and each has the same program number. So I have to edit each one to the appropriate number. It would be much better if Mastercam handled this automatically.

Link to comment
Share on other sites

Rotary Ninja having messed with this some before.. it sure seems like the program number thats assigned to the first operation that is posted is used and the rest are pretty much ignored.. I could be wrong .. but I have noticed that the only one that actually changes the program number when posting a file is the first one.

 

Based on my messing with posts some.. and on just testing this out a bit, this is what seems to be happening under the hood so to speak..

 

When the program is posted out it runs the entire NCI file.. the NCI file is created from all the operations that are selected and that are grouped together with the same output filename ie op10.nc, op20.nc etc..

 

It will only ever use ONE program number per NCI file (the one from the first op in the group of files with that output NC filename it looks like),

However it WILL create a new NCI file for a each unique NC filename.. and since its a new NCI file it WILL use the program number that is assigned to the first operation using that NC filename)

 

So anyhow.. just posted 4 NC files from one MCX file by simply making all my ops.. selecting all for program one and right clicking and choose Edit Selected Operations and change NC filename.. Then select those same operations again and choose change program number.

 

Repeat those steps as nescessary for each output filename / program number you want, then when you post you will get multiple NC files each with thier own O number based on how you assigned them in the operations manager. FYI .. they dont even need to be in different toolpath groups for it to work

  • Like 1
Link to comment
Share on other sites

Thanks guys for doing some testing on this.

 

Since we can set the Program Number and NC File Name already, it sounds like the underlying structure is already there. I'll do some more digging.

 

If there is functionality that would be useful to you, then please send in an enhancement request. If we get enough requests for a feature, it bumps up the priority for development...

 

Thanks for pointing out that you can set program numbers independently using that Right-Click menu option. I'd forgotten about that one.

Link to comment
Share on other sites

This can be done though the post; In the following file subprograms are auto-incremented to be called up by a routing subprogram. I wrote this for our shop but this can also be done for full stand alone programs inside the "standard" post (if there is one). There's work and time involved but once it's running it would easily pay for itself. I'm sure the good people that owns this forum would be happy to write one up for a fee if you don't have the time to do it yourself, but if you do you will have gained a tremendous amount of knowledge and experience to get you through any other post issues you come across.

 

 

O4012

(4" LONG PROBE LOWER PART)

IF[#153EQ#0]GOTO1

N0100 G00 G90 X-1.75 Y-19.368 (B0.) M19

 

N0290 #[[[#4130*20]-20]+7003]=#5303

N1 M99

 

O4022

(1/2" THREE FLUTE CARBIDE END MILL 0 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N0300 G00 G90 X2.65 Y-.35 (B0.)

 

N5930 G00 Z1.1

N5940 Z4.16

N1 M99

O4032

(1/8" THREE FLUTE STUB LENGTH CARBIDE END MILL 0 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N5950 G00 G90 X2.4859 Y-.15 (B0.)

 

N6550 G00 Z1.09

N6560 Z4.16

N1 M99

 

O4041

(3.10 MM THROUGH COOLANT CARBIDE DRILL 90 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N6570 G00 G90 X-.69 Y.581 (B90.)

..

N6620 G00 Z11.58

N1 M99

 

O4051

(NO.2 CENTER DRILL 90 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N6630 G00 G90 X-.69 Y.581 (B90.)

..

N6680 G00 Z11.58

N1 M99

..

O4061

(6-32 ROLL TAP 90 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N6690 G00 G90 X-.69 Y.581 (B90.)

..

N6770 G00 Z11.58

N1 M99

 

O4072

(5.10MM COOLANT THROUGH CARBIDE DRILL 0 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N6780 G00 G90 X2.1004 Y6.7994 (B0.)

..

N6830 G00 Z4.16

N1 M99

 

O4082

(NO.4 CENTER DRILL 0 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N6840 G00 G90 X2.1004 Y6.7994 (B0.)

..

N6910 G00 Z4.16

N1 M99

 

O4092

(1/4-20 PLUG TAP 0 DEGREE SIDE)

IF[#153EQ#0]GOTO1

..

N7000 G00 Z4.16

N1 M99

 

O4102

(17/64" COOLANT THRU CARBIDE DRILL 0 DEGREE SIDE)

IF[#153EQ#0]GOTO1

..

N1 M99

 

O4112

(1" 82 DEGREEE COUNTERSINK 0 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N7070 G00 G90 X.925 Y2.39 (B0.)

..

N1 M99

 

O4122

(1/4" 90 DEGREE SPOTTING DRILL 0 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N7130 G00 G90 X2.95 Y0. (B0.)

..

N7360 Z4.16

N1 M99

 

O4132

(4" LONG PROBE LOWER PART)

IF[#153EQ#0]GOTO1

N7370 G00 G90 X-3.74 Y-16.531 (B0.) M19

..

N7560 #[[[#4130*20]-20]+7003]=#5303

N1 M99

 

O4142

(3" DIA FACE MILL FOR ALUM 0 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N7570 G00 G90 X8.74 Y-1.8499 (B0.)

..

N7710 G00 Z.89

N7720 Z4.625

N1 M99

 

O4151

(NO.25 COOLANT THROUGH CARBIDE DRILL 90 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N7730 G00 G90 X-.03 Y-.75 (B90.)

..

N7780 G00 Z13.94

N1 M99

 

O4161

(NO.4 CENTER DRILL 90 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N7790 G00 G90 X-.03 Y-.75 (B90.)

..

N7840 G00 Z13.94

N1 M99

 

O4171

(8-32 ROLL TAP 90 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N7850 G00 G90 X-.03 Y-.75 (B90.)

..

N7930 G00 Z13.94

N1 M99

 

O4182

(1/2" THREE FLUTE CARBIDE END MILL 0 DEGREE SIDE)

IF[#153EQ#0]GOTO1

N7940 G00 G90 X-.35 Y.1062 (B0.)

..

N11050 G00 Z.795

N1 M99

%

 

Edit: Notice the the 90° side subs end with a 1 while the 0° sides end with a 2 while incrementing automagically.

Link to comment
Share on other sites

Tim nice job , but you are showing it as subs. He does not run subs as a mold maker but will have one file that contains mutable paths that he will run one after another. so he wants to post all then put them in one at a time.

Am I correct Metal_ Eater

 

I am not sure why they need to have different program numbers as in most you will run one then post the next one out and send.

As most mold makers will never run that program again.

Link to comment
Share on other sites

Jay, in your video that is exactly the way I set my program numbers. Thanks for the video clarifying that method. It would be nice if doing that could all be handled automatically in the System Configuration setting.

 

What I am suggesting is in the System Configuration>>>Toolpath Manager page there be a setting for "Program # Start". Then another setting for "Increment Value". It would be tied to the Toolpath Group's Appended value. Then the Program # Appended value would increment the program number for each Toolpath Group you create by the value you enter into this Program # Append value.

toolpath-manager_zps85907452.png

 

 

The only thing is the Program # setting in the Tool Settings tab in the Machine Group properties window would have to go away. Because that is where the default program # comes from. This seems like a really weird place for this anyway.

toolsettings_zps1cf85759.png

  • Like 1
Link to comment
Share on other sites

When the program is posted out it runs the entire NCI file.. the NCI file is created from all the operations that are selected and that are grouped together with the same output filename ie op10.nc, op20.nc etc..

 

It will only ever use ONE program number per NCI file (the one from the first op in the group of files with that output NC filename it looks like),

However it WILL create a new NCI file for a each unique NC filename.. and since its a new NCI file it WILL use the program number that is assigned to the first operation using that NC filename)

 

So anyhow.. just posted 4 NC files from one MCX file by simply making all my ops.. selecting all for program one and right clicking and choose Edit Selected Operations and change NC filename.. Then select those same operations again and choose change program number.

 

.....then when you post you will get multiple NC files each with thier own O number based on how you assigned them in the operations manager. FYI .. they dont even need to be in different toolpath groups for it to work

I do this all the time and it works quite well. I already have to name the different groups according to the OP I am machining, choosing a different Program # is a few clicks away. I must agree though that if you copy tool paths from a previous operation they will carry over the old NCI filename and Program #; the solution to this is to create a new machine group but we've been down this road before !

 

GM

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...