View Full Version : Help with adding subprograms to post processor


creep_pea
01-06-2006, 07:44 AM
I'm want to add subprograms to my post processor.

As the supplied post didn't support subprograms, I've started to change the standard MPFAN post to suit. This has worked very well so far but I'm having to move the subprograms from the end of the G code program upto the start of the program manualy.
I would really like to change this to it automaticly in the post.

Any help would be greatly appriated

Cheers

Chris

creep_pea
01-06-2006, 08:49 AM
Update

I think I've found the code that puts the subprograms in, well if I move MERGEAUX up a couple of lines i.e. above line n, "M02", e. Then the subprograms are placed above the line containing M02 but when moving MERGEAUX so it is just below the program no. i.e. below line *progno, e. The subprograms dissapear totaly.

Thanks

Chris

creep_pea
01-09-2006, 06:40 AM
Still can't do it.

Someone help please even if you just tell me it is not possible.

Cheers

Chris

CAMFUN
02-15-2006, 07:55 AM
Hi Chris, for sure that is possible. Mastercam has a great handling with subprogs. But in order to define them into your post, itīs very complicated. It depends on a lot of variables and settings inside the post. The answer for you question is not so simple, not even short. but yes, is possible to get subprogs in Mastercam (And they works perfectly when proper configured in the post), but is complicated to define them also. Get in touch with your dealer and ask for him about the MP Guide, available in CD-ROM.


Cheers

creep_pea
02-16-2006, 10:27 AM
Thanks for the reply, I'll look out for the CD.

Just thought someone would be using subprograms on a brigdeport with there very limited memory and there been so many of them around.

Cheers

Chris

chuy
03-16-2006, 08:31 PM
I have a post but it's for a fanuc if you like I can e-mail it to and maybe you could get an idea of how they are used and edit your own pp I have mine just the the way i like it..
just pm me and i'll e-mail it to you.
here is a sample of how it posts.

O0015(ITEM 1 -OP2 WHAT HAPPEN FIXTURE.NC)
(DATE= 16-03-06 TIME=17:29)
(DRILL)
( 1/4 SPOTDRILL TOOL - 1 DIA. OFF. - 31 LEN. - 1 DIA. - .25)
N1G0G40G49G80G90Z0
M107
T1M6
G54X-.3001Y-3.4943S6000M3
M8
G43H1Z.2M8
M98P0001
(DRILL)
G90G55X-.3001Y-3.4943
Z.2
M98P0001
(DRILL)
G90G56X-.3001Y-3.4943
Z.2
M98P0001
G90G54X.21Y-2.745
Z.2
M98P0002
G90G55X.21Y-2.745
Z.2
M98P0002
G90G56X.21Y-2.745
Z.2
M98P0002
G0Z1.M9
G49Z0M5
G28G91Y0
M01
(10-32 PILOT HOLES)
( #21 DRILL TOOL - 2 DIA. OFF. - 32 LEN. - 2 DIA. - .159)
N2G0G40G49G80G90Z0
M107
T2M6
G54X-.3001Y-3.4943S3000M3
M8
G43H2Z.2
M98P0003
(10-32 PILOT HOLES)
G90G55X-.3001Y-3.4943
Z.2
M98P0003
(10-32 PILOT HOLES)
G90G56X-.3001Y-3.4943
Z.2
M98P0003
G0Z1.M9
G49Z0M5
G28G91Y0
M01
(6-32 PILOT HOLES)
( #36 DRILL TOOL - 3 DIA. OFF. - 33 LEN. - 3 DIA. - .1065)
N3G0G40G49G80G90Z0
M107
T3M6
G54X.21Y-2.745S6000M3
M8
G43H3Z.2
M98P0004
(6-32 PILOT HOLES)
G90G55X.21Y-2.745
Z.2
M98P0004
(6-32 PILOT HOLES)
G90G56X.21Y-2.745
Z.2
M98P0004
G0Z1.M9
G49Z0M5
G28G91Y0
M01
(10-32 PILOT HOLES TAP)
( #10-32 TAPRH TOOL - 4 DIA. OFF. - 34 LEN. - 4 DIA. - .19)
N4G0G40G49G80G90Z0
M107
T4M6
G54X-.3001Y-3.4943S1000M3
M8
G43H4Z.2
M98P0005
(10-32 PILOT HOLES TAP)
G90G55X-.3001Y-3.4943
Z.2
M98P0005
(10-32 PILOT HOLES TAP)
G90G56X-.3001Y-3.4943
Z.2
M98P0005
G0Z1.M9
G49Z0M5
G28G91Y0
M01
(6-32 PILOT HOLES)
( #6-32 TAPRH TOOL - 5 DIA. OFF. - 35 LEN. - 5 DIA. - .138)
N5G0G40G49G80G90Z0
M107
T5M6
G54X.21Y-2.745S1000M3
M8
G43H5Z.2
M98P0006
(6-32 PILOT HOLES)
G90G55X.21Y-2.745
Z.2
M98P0006
(6-32 PILOT HOLES)
G90G56X.21Y-2.745
Z.2
M98P0006
G0Z1.M9
G49Z0M5
G28G91Y0
M30

O0001
G81G98Z-.1R.1F20.
Y.0857
X5.2799
Y-3.4943
G80
M99

O0002
G81G98Z-.07R.1F20.
Y-.62
X4.82
Y-2.745
G80
M99

O0003
G83G98Z-.6R.1Q.1F15.
Y.0857
X5.2799
Y-3.4943
G80
M99

O0004
G83G98Z-.6R.1Q.1F18.
Y-.62
X4.82
Y-2.745
G80
M99

O0005
G84G98Z-.5R.15F31.25
Y.0857
X5.2799
Y-3.4943
G80
M99

O0006
G84G98Z-.5R.15F31.25
Y-.62
X4.82
Y-2.745
G80
M99
%

ObrienDave
03-31-2006, 10:47 PM
It would be easier to start with a post that already supports subprograms.
Then modify it to suit your machine and controller.
I'm pretty sure the Fadal post supports subprograms as you describe them.

Mike Mattera
04-02-2006, 12:19 PM
If your using a current MPFan (V9 & up) it already supports subs. It's all in what you pick on the Parameter page, when your doing your toolpath.

Contour: Pick Depth Cuts and check the Subs box.

If your doing a toolpath Transformation. Same thing. Look for the Subs check box.

You shouldn't have to modify the post to get subs. You might need to modify it for a particular format, but it should be there already.

Mike Mattera

creep_pea
04-04-2006, 06:08 PM
Thanks for the comments even though most of you got the wrong end off the stick, I do still appreciate the help.

A big thanks to ObrienDave thats exactly what I was after, I just copied loads of that post into mine not really sure which bit made it work but it does so I'm happy.

This is what I wanted to get (simple program milling a square a few times for a example)

#1
N112X50.
N114Y0.
N116X0.
N118Y50.
$
N100G71G17
N102G0G90T1M6S1909
N104X0.Y50.
N106Z50.
N108Z2.
N110G1Z-2.F382
=#1
N120G90Z-4.
=#1
N130G90Z-6.
=#1
N140G90Z-8.
=#1
N150G90Z-10.
=#1
N160G0G90Z50.
N162M02

What I was getting before which doesn't work

N100G71G17
N102G0G90T1M6S1909
N104X0.Y50.
N106Z50.
N108Z2.
N110G1Z-2.F382
=#1
N120G90Z-4.
=#1
N130G90Z-6.
=#1
N140G90Z-8.
=#1
N150G90Z-10.
=#1
N160G0G90Z50.
N162M02

#1
N112X50.
N114Y0.
N116X0.
N118Y50.
$

And last but not least the original Post version

.N100G70G75G90
N102G0X0.Y0.T1M6
N104X0.Y50.
N106Z50.
N108Z2.
N110G1Z-2.F3818
N112X50.
N114Y0.
N116X0.
N118Y50.
N120G0Z-4.
N122X50.
N124Y0.
N126X0.
N128Y50.
N130G0Z-6.
N132X50.
N134Y0.
N136X0.
N138Y50.
N140G0Z-8.
N142X50.
N144Y0.
N146X0.
N148Y50.
N150G0Z-10.
N152X50.
N154Y0.
N156X0.
N158Y50.
N160G0Z50.
N162G0Y0.M2

jrebel
11-13-2006, 11:56 AM
Has anyone used sub-programs to send the machine to it's index position? I want to program a vtl where I can use different subprograms for the index position for different jobs. What is the format like and how does it work?
Thanks.