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:
I am currently modifying a MPFAN post to reformat the sub programs output. I would like the subprogram number to be 4 digits. Digit 2-4 = tool number, and digit 1 = call number. "Call number" meaning if T2 is called 3 times in the same program I'd like the first call sub number to be 1002 the second sub to be 2002 and third to be 3002.
Is there a simple way to do this? My c++ brain is saying just make an array of all the tool numbers as you use them and loop thru the array every time you need to output a subprogram number to check how many times the tool has been previously used. But not sure if that code would be a pain to write into a post.
I also see that I could use pwrtt$ to pre-read all the tool numbers. So I could track how many times each tool is used and then somehow use that when I'm ready to output sub numbers?
Any info is appreciated! MC2023 TIA
We use custom fixtures.
Matsuura H.Plus-630 4-axis HMC. We have a custom tombstone on the machine pallet and custom fixtures on the tombstone.
Tombstone City Link This is similar to the custom tombstones we use.
The fixtures are all 4140 steel with mitee bites to hold the parts.
You ain't kidding. We've got a job with 110 tools and each has its own separate sub program, really makes a mess.
After changing the parameters James suggested this is the code I end up with:
%
O1314(MAIN PROGRAM)
(T1 SUB CALL)
M98 P0001 Q1234
(T2 SUB CALL)
M98 P0001 Q1235
M30
%
%
O0001(SUBPROGRAMS)
(T1 SUB)
N1234
(CODE)
M99
(T2 SUB)
N1235
(CODE)
M99
%
So I have a main program and I have a second program with all my sub programs in it. The Pxxxx is still a regular subprogram call, but the Qxxxx tells the machine to start on line Nxxxx within the subprogram.
My next question is what you use for a naming convention, here's what I'm thinking:
N101033
10 (op#10) 1 (1st call) 033 (tool #33)
N253112
25 (op#25) 3 (3rd call) 112 (tool #112)
Because we will have multiple ops, and possibly multiple tool callouts, this seems like a good solution. But I'm interested to hear others thoughts on this.
Here's the response from @cncappsjames:
Set #3201.6(NPE) = 1 Program registration not completed on M02, M30, or M99
Set #3201.5(N99) = 1 Program registration not completed on M99
Set #6005.0 (SBC) = 1 This will allow you to use Q as a line number jump.
I have not tested this yet but it looks promising. I'll return with results after testing.
Fanuc G-Tech 16i
I'll take a look thru the book because I've only ever seen M98 Pxxxx to call Oxxxx. I've never seen M98 Hxxxx to call Nxxxx.
I'll follow up
Here's the current code:
%
O1314
G90 G80 G40 G0 G49 G17
N138 M6 T138 ( 1/2 EM )
M22
G90 G0 G54.1 P1 B0.
M21
G5.1 Q1
G0 G90 G54.1 P1 X-3.1165 Y-2.3 S7640 M3
G43 H138 Z1. M8 T104
M50
M98 P0001
G90 G54.1 P8 X-3.1165 Y-2.3
Z1.
M98 P0001
G5.1 Q0
M09
M22
M5
G49 G53 Z0.
M00 (changed from M30)
O0001
(code)
M99
%
We just tried loading this into the machine and it split the programs into two programs O1234 and O0001.
I was excited about the changing the M30 suggestion but it seems like the machine may break up the program each time it sees an O.
Thanks for the response. If they're all in a single file, when we load them into the machine it splits them into separate files. Then when we go to save the programs they save as separate files. So we either have to mush them all back together, or save each file individually. I imagine it would be less work to start with them split up.
If there's a better way around this issue I'm all ears. We don't do a ton with sub programs so I'd guess our "sub program best practices" may be lacking.
I was hoping the link in the OP was still good but it's not.
I'm working with a slightly modified MPFAN post, looking to have subprograms output as individual files. A while back I saw a post explaining how to do this but I can't seem to find it again. Any chance someone can point me in the right direction here? I honestly don't know where to even start.
MC2023 TIA
Is there a config setting somewhere to change the default file for verify options? I can't seem to find anything.
In a verify session > File > Defaults > Save to Defaults allows you to save your current settings to an xml file. But I can't find where to set the new xml file as default instead of "MastercamSimulatorDefaults.xml"
Current work around is: in a verify session > File > Defaults > Read from Defaults > select saved xml file.
MC2023 TIA
Used to be 5 of us programming for about 15 3-axis VMC, 7 4-axis HMC, 6 5-axis.
Since then we've added some machines and we're up to 8 mill programmers.
Now a days I personally do a mix of process improvement and new parts. Whatever the boss thinks we can/should be making more money on hits my desk, it's a pretty cool gig.
This might be dumb but I'll put it out there anyway. If I recall correctly a few years ago when we got our Quaser MV184 the first time we went to tool change it alarmed out. The guy helping with the install changed the "hands" on the ATC and the issue was fixed. I believe he said the machine could run CAT40 or BT40 by just changing the ATC "hands".
Possible this is the case with your machine too? Again, I could be way off here.
I think I'm in the minority on this one but I like the dashed glowing lines. I never knew MC without them so I was never used to the "old" way.
Tried turning them off one time and I didn't make it a couple hours before turning them back on.
Sometimes we clean up the steps with a ghost pass at a different z depth.
Ex. If your steps are Z0, Z-.100, Z-.200. After cutting to finish take two more passes at Z-.050 and z-.150
You'll still end up with some kind of depth cut lines but that should mostly eliminate any steps.
Not sure what the overall process looks like but on our 4-axis HMC's we always program a single work offset from POR. The only time our pickup isn't POR is if there's no rotations, then we usually do some type of 3-axis pickup. I always figured programming from POR was industry standard, maybe not?
We also use tooling balls if we need them.
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.