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:

SubPrograms


Recommended Posts

I'm working on converting my programs to subprograms for each tool. Our repeat orders vary in quantity so doing this makes it easier to add/remove vises and quickly change the program with two lines of code.

 

When the program posts out, it creates a sub for each offset. I'd like to create one sub and reference that same sub for each offset instead.

 

 

Here is how it is currently posting:

N15 T1 M06 (17/32 DRILL)
N20 M08
N25 G00 G17 G90 G54 X1.4764 Y-.625 S1438 M03
N30 G43 H1 Z5. T2
>>>N35 M98 P2807<<<
N40 G90 G55 X1.4764 Y-.625 Z5.
>>>N45 M98 P2808<<<
N50 M09
N55 M05
N60 G91 G28 Z0.
N65 M01

...

...

...

 

O2807
N5 G90
N10 Z1.35
N15 G94
N20 G99 G73 Z-.1896 R1.35 Q.08 F13.
N25 X5.4134
N30 X9.3504
N35 X13.2874
N40 X17.2244
N45 G80
N50 Z5.
N55 M99

O2808
N5 G90
N10 Z1.35
N15 G99 G73 Z-.1896 R1.35 Q.08 F13.
N20 X5.4134
N25 X9.3504
N30 X13.2874
N35 X17.2244
N40 G80
N45 Z5.

 

Here is how I'd like it to post:

N15 T1 M06 (17/32 DRILL)
N20 M08
N25 G00 G17 G90 G54 X1.4764 Y-.625 S1438 M03
N30 G43 H1 Z5. T2
>>>N35 M98 P2807<<<
N40 G90 G55 X1.4764 Y-.625 Z5.
>>>N45 M98 P2807<<<
N50 M09
N55 M05
N60 G91 G28 Z0.
N65 M01
Link to comment
Share on other sites

Check  my settings..

I believe that is what you're look to do..

 

subprogram sample.mcam

%
O0000(SUBPROGRAM SAMPLE)
(DATE=DD-MM-YY - 15-05-20 TIME=HH:MM - 14:21)
(MCAM FILE - C:\USERS\JOHNP\DESKTOP\SUBPROGRAM SAMPLE.MCAM)
(NC FILE - C:\USERS\JOHNP\DESKTOP\SUBPROGRAM SAMPLE.NC)
(MATERIAL - ALUMINUM INCH - 6061)
( T1 |  1/2 FLAT ENDMILL | H1 | D1 | WEAR COMP | TOOL DIA. - .5 )
( T2 | 17/32 DRILL | H2 )
N100 G20
N110 G0 G17 G40 G49 G80 G90
( 1/2 ENDMILL / F-MILL PERIMTER / Z-.250 )
N120 T1 M6
N130 G0 G90 G55 X.7879 Y.4104 A0. S1069 M3
N140 G43 H1 Z1.
N150 M98 P0001
( 1/2 ENDMILL / F-MILL PERIMTER / Z-.250 )
N160 G90 X.7879
N170 M98 P0001
( 1/2 ENDMILL / F-MILL PERIMTER / Z-.250 )
N180 G90 X.7879
N190 M98 P0001
( 1/2 ENDMILL / F-MILL PERIMTER / Z-.250 )
N200 G90 X.7879
N210 M98 P0001
N220 M5
N230 G91 G28 Z0.
N240 A0.
N250 M01
( 17/32 DRILL / DRILL THRU / Z-.75 )
N260 T2 M6
N270 G0 G90 G54 X1. Y-1. A0. S503 M3
N280 G43 H2 Z1.
N290 M98 P0002
( 17/32 DRILL / DRILL THRU / Z-.75 )
N300 G90 G55 X1. Y-1. Z1. A0.
N310 M98 P0002
( 17/32 DRILL / DRILL THRU / Z-.75 )
N320 G90 G56 X1. Y-1. Z1. A0.
N330 M98 P0002
( 17/32 DRILL / DRILL THRU / Z-.75 )
N340 G90 G57 X1. Y-1. Z1. A0.
N350 M98 P0002
N360 M5
N370 G91 G28 Z0.
N380 G28 X0. Y0. A0.
N390 M30
 
O0001
N100 Z.1
N110 G1 Z-.25 F6.42
N120 G41 D1 X.9116 Y.2866
N130 G3 X1. Y.25 I.0884 J.0884
N140 G1 X2.
N150 G2 X2.25 Y0. I0. J-.25
N160 G1 Y-2.
N170 G2 X2. Y-2.25 I-.25 J0.
N180 G1 X0.
N190 G2 X-.25 Y-2. I0. J.25
N200 G1 Y0.
N210 G2 X0. Y.25 I.25 J0.
N220 G1 X1.
N230 X1.03
N240 G3 X1.1184 Y.2866 I0. J.125
N250 G1 G40 X1.2421 Y.4104
N260 G0 Z1.
N270 M99
 
O0002
N100 G98 G83 Z-.75 R.1 Q.225 F4.27
N110 G80
N120 M99
%

 

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