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:

Post Processor Question..


Dan@home
 Share

Recommended Posts

Back when we manually programmed our machines (Heidenhain Control), we would program our subroutines inline as we went. This made the program much more user readable. When we went the CAM way, that somewhat went out the door and we don't even program subs. We try to keep the programs as easy to follow as possible - mainly for the guys who've been here a while and were accustomed to programming by hand. Having the subs at the end of large programs makes it difficult to follow as it goes along. I would like to use subs, but since I can't put them inline, I just don't mess with them.

Link to comment
Share on other sites

If you just want your "subs" attached to the main file, then yes, Mastercam can do this as one file. More current controls can load this as one file but break out/recognize the different "subs". I'm not sure what you might mean about "inside the body of the main program"

 

Just a simple man with a simple plan!

 

Mcam X2-MR2-SP1

Mill Level 3

Lathe Level 1

Solids

5 Axis

Link to comment
Share on other sites

quote:

The Main & subs are broken up when sent to the Hass machine. All you see is main program, or subs, depending on the one you call up.

Now it makes sense what you are looking to do. No, you cannot "see" more than one program at a time on the HAAS control.

You could write a post to do then "IF", "THEN", "GOTO" commands stated above.

 

 

Just a simple man with a simple plan!

 

Mcam X2-MR2-SP1

Mill Level 3

Lathe Level 1

Solids

5 Axis

Link to comment
Share on other sites

Is this what you want to see?

 

code:

%

O1000(FIXTURE-TAP)

( T7 | 3/4" SPOTDRILL )

( T2 | 17/32 DRILL )

( T32 | 5/8-11 TAPRH )

G0 G91 G30 Z0.

G0 G91 G30 Y0. X0.

G0 G17 G20 G40 G49 G80 G90

( SPOT DRILL ALL LOCATIONS )

T7

M6 ( 3/4" SPOTDRILL )

T2 (NEXT TOOL)

G0 G90 G54 X-8. Y4.139 B0. S330 M3

G43 H7 Z6.

M8

G98 G81 Z4.6875 R5.1 F2.

M98 P1001

G80

M9

G0 G91 G30 Z0.

G0 G91 G30 Y0. X0.

M01

( DRILL 17/32 FOR 5/8-11 )

T2

M6 ( 17/32 DRILL )

T32 (NEXT TOOL)

G0 G90 G54 X-8. Y4.139 B0. S503 M3

G43 H2 Z6.

M8

G98 G83 Z3. R5.1 Q.1 F4.27

M98 P1001

G80

M9

G0 G91 G30 Z0.

G0 G91 G30 Y0. X0.

M01

( TAP 5/8-11 )

T32

M6 ( 5/8-11 TAPRH )

T7 (NEXT TOOL)

G0 G90 G54 X-8. Y4.139 B0.

G43 H32 Z6.

M8

G95

M29 S427

G98 G84 Z3.5 R5.1 F.0909

M98 P1001

G80

G94

M9

G0 G91 G30 Z0.

G0 G91 G30 Y0. X0.

M30

 

O1001

G91

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X-16. Y2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X-16. Y2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X-16. Y2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X-17. Y2.

X1.

X1.

X1.

X1.

X1.

X1.

X1.

X4.

X1.

X1.

X1.

X1.

X1.

X1.

X1.

X-18. Y5.25

X1.

X1.

X1.

X1.

X1.

X1.

X1.

X4.

X1.

X1.

X1.

X1.

X1.

X1.

X1.

X-17. Y1.75

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X-16. Y2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X-16. Y2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X-16. Y2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X-16. Y2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X-16. Y2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

X2.

M99

%

Link to comment
Share on other sites

We've done something for 'subroutines' vs. 'subprograms' in a Millplus post, which relied on jump commands to specific line numbers. Since it's internal to the same program you can get into some serious sequence number bookkeeping. Or you can devise blocks for the subroutine sequence numbers with some assumptions. In general, pain in the posterior as I recall.

Link to comment
Share on other sites

quote:

If you change your post to output an M97(LOCAL sub routine call) instead of M98 (sub routine call) and change the sub routine program number to begin with an N ,then it should all stay together when loading it into the control.


There is a post on the FTP that does this, keeping everything in a single file, using the M97. I think that name is MillX_HAAS-VF.zip.

 

It would also be a very simple edit for mpfan. Change the M98 to M97, the "P" to "N", and remove the % from the end of each sub. Each sub is marked with a N number instead of "O".

Link to comment
Share on other sites

I don't work with extremely long programs here so this might not help, but, I set up my post to start numbering my sub programs at N5000, then I set up my control def. so my maximum sequence number is 4990, this way I never have a block number in my program that can be confused as a sub routine.

code:

result = nwadrs(strp, main_prg_no$)

main_prg_no$ = main_prg_no$ + sav_progno *.0 +5000 #Add sub number offset

this is from my psub_call_trans section,

 

 

then this next bit would be from my psub_call_s section

 

code:

result = nwadrs(strp, sub_prg_no$)

sub_prg_no$ = sub_prg_no$ + sav_progno *.0 + 6000 #Add sub number offset

HTH

Link to comment
Share on other sites

This is what I get when I transform/translate/toll plane(tool plane only) , leaving all misc values to 0. This from the suggested post above.

code:

 %

O1111(DE_1)

(DATE - 02-04-08-11:34)

(PROGRAMMED FOR HAAS MILL)

 

(START TOOL LIST)

(T239 1/2 FLAT ENDMILL, .5 DIA)

(END TOOL LIST)

 

( 2" SQUARE )

 

G0 G80 G40 G20

T239 M6 ( 1/2 FLAT ENDMILL )

G0 G90 G54 X-2.25 Y-.5 S1069 M3

G43 H239 Z.25

M98 P0001

( 2" SQUARE )

G90 G55 X-2.25 Y-.5

M98 P0001

( 2" SQUARE )

G90 G56 X-2.25 Y-.5

M98 P0001

M5

M9

G0 G28 G91 Z0

G0 G90 G129 X0. Y0.

G56

M30

 

O0001

Z.1

G17 G1 Z-.125 F6.4176

X-1.75

G3 X-1.25 Y0. I0. J.5

G1 Y1.25

X1.25

Y-1.25

X-1.25

Y0.

G3 X-1.75 Y.5 I-.5 J0.

G1 X-2.25

Z-.025

G0 Z.25

M99

%


No M97s, just your standard code output (sub programs) No N#s. Even when I turn on numbering, same code. Am I missing something?

 

 

Daniel.

Link to comment
Share on other sites

Daniel, I am not familiar with Haas, the post I referenced is for a Mazak. you need to change some string adresses to get your N

code:

#Address string definitions

stri "I"

strj "J"

strk "K"

strm "M"

strn "N"

stro "N"

strp "H"

srad "R"

srminus "R-"

strz "Z"

you'll notice I changed the adress for o to "N"

and for this post I need an "H" after my M98 instead of a P so I changed the adress for strp to output an "H"

 

You'll also need to alter your format statements

 

( example )

code:

fmt ":" 20   main_prg_no$ #Program number

fmt N 19 sub_prg_no$ #Program number

#fmt ":" 7 sub_prg_no$ #Program number

fmt H 19 sub_prg_call #Program number

I'm not a post guy, I do things by trial and error...our Mazaks use a colon to Identify the main program not an "O", I don't know if this will change your main program identifier to an "N" or not, I don't think so.

 

you also need to change "M98" in you post to "M97" if that is the output you need.

 

here is an ex. of my output

 

:1111

(P/N:666880111)

(REV.:A)

(DESC.:MOUNTING PLATE)

(OPER.:1ST)

(MASTERCAM - X)

(MCX FILE - C:MCAMX2-MR2666880111_1ST.MCX)

(FILENAME - 1111.EIA)

(DATE - FEB-04-2008)

(TIME - 2:13 PM)

(T9 - 17/64 DIA. SGS HI-PERCARB - H9 - D39 - D0.2650")

(T10 - 4.2MM DIA. THRU TOOL CARBIDE - H10 - D40 - D0.1654")

(T11 - 9/32 DIA. SGS HI-PERCARB, 5 TIMES - H11 - D41 - D0.2810")

(OVERALL MAX - Z.5)

(OVERALL MIN - Z-.5082)

N5 G00 G17 G20 G40 G80 G90

N10 T9

(17/64 DIA. SGS HI-PERCARB TOOL - 9 )

( DIA. OFF. - 39 LEN. - 9 )

(COMPENSATION TYPE - OFF)

( PROGRAMMED DIA. - .265)

N15 (5/16-18 TAP DRILL)

N20 M06 T9 (17/64 DIA. SGS HI-PERCARB)

N25 T10

N30 S5766 M03

(MAX - Z.5)

(MIN - Z-.5082)

N35 M08

N40 G00 G90 G54 X-2.752 Y-.752

N45 G43 H9 Z.5

N50 G64

N55 M98 H5002

N60 G64

N65 (5/16-18 TAP DRILL)

( DIA. OFF. - 39 LEN. - 9 )

( COMPENSATION TYPE - OFF )

N70 G90 G55 X-2.752 Y-.752 Z.5

N75 G64

N80 M98 H5002

N85 M09

N90 G91 G64 G28 Z0. M05

N95 M01

(4.2MM DIA. THRU TOOL CARBIDE TOOL - 10 )

( DIA. OFF. - 40 LEN. - 10 )

(COMPENSATION TYPE - OFF)

( PROGRAMMED DIA. - .165354)

N100 (10-32 TAP DRILL)

N105 M06 T10 (4.2MM DIA. THRU TOOL CARBIDE)

N110 T11

N115 S8054 M03

(MAX - Z.5)

(MIN - Z-.4861)

N120 M51

N125 G00 G90 G54 X-2.268 Y-.858

N130 G43 H10 Z.5

N135 G64

N140 G04 P1000

N145 M98 H5003

N150 G64

N155 (10-32 TAP DRILL)

( DIA. OFF. - 40 LEN. - 10 )

( COMPENSATION TYPE - OFF )

N160 G90 G55 X-2.268 Y-.858 Z.5

N165 G64

N170 M98 H5003

N175 M09

N180 G91 G64 G28 Z0. M05

N185 M01

(9/32 DIA. SGS HI-PERCARB, 5 TIMES TOOL - 11 )

( DIA. OFF. - 41 LEN. - 11 )

(COMPENSATION TYPE - OFF)

( PROGRAMMED DIA. - .281)

N190 (DRILL .281 DIA. THRU 8 PLCS.)

N195 M06 T11 (9/32 DIA. SGS HI-PERCARB, 5 TIMES)

N200 T9

N205 S4760 M03

(MAX - Z.5)

(MIN - Z-.5043)

N210 M08

N215 G00 G90 G54 X-1.5 Y-.5

N220 G43 H11 Z.5

N225 G64

N230 M98 H5004

N235 G64

N240 (DRILL .281 DIA. THRU 8 PLCS.)

( DIA. OFF. - 41 LEN. - 11 )

( COMPENSATION TYPE - OFF )

N245 G90 G55 X-1.5 Y-.5 Z.5

N250 G64

N255 M98 H5004

N260 M09

N265 G91 G64 G28 Z0. M05

N270 G28 Y0.

N275 G90 M06 T9

N280 M152

N285 M30

 

N5002

(5/16-18 TAP DRILL)

N5 G98 G81 Z-.5082 R.1 F57.66

N10 X-5.248

N15 Y-3.248

N20 X-2.752

N25 G80

N30 M99

 

N5003

(10-32 TAP DRILL)

N5 G98 G81 Z-.4861 R.1 F56.

N10 X-4.552

N15 Y-3.142

N20 X-2.268

N25 G80

N30 M99

 

N5004

(DRILL .281 DIA. THRU 8 PLCS.)

N5 G98 G81 Z-.5043 R.1 F36.

N10 X-.5

N15 Y-1.5

N20 X-1.5

N25 Y-2.5

N30 X-.5

N35 Y-3.5

N40 X-1.5

N45 G80

N50 M99

%

feel free to e-mail me if I missed something. HTH

mike

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