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:

SUB PROGRAMS


perseid88
 Share

Recommended Posts

I have used a sub program only once in the last few years and my program looked something like this

:001111

N100( NAME - 4110)

N102( DATE - 03-21-02)

N104 ( START TOOL LIST )

N106 ( T01 1-1/4 DRILL )

N108 ( T01 MAX DEPTH -1.1255 )

N110 ( END TOOL LIST )

 

N112 ( ZONE 1 )

N114 G20

N116 G80

N118 G90 G97

N120 G28 X0 Y0 Z0 H0

N122 G00 Z.2

N130 G54 P6

N132 G00 X60.8125 Y14.1824 M98 P6

N142 X60.8125 Y17.3217 M98 P6

N144 X60.8125 Y20.4611 M98 P6

N146 X59.9063 Y22.0307 M98 P6

N148 X59.9063 Y18.8914 M98 P6

N4248 X-26.8731 Y54.4206 M98 P6

N4250 X-26.8731 Y56.1706 M98 P6

N4252 X-26.8731 Y57.9206 M98 P6

N4254 X-28.3887 Y57.0456 M98 P6

N4256 X-28.3887 Y55.2956 M98 P6

N4258 X-28.3887 Y53.5456 M98 P6

N4260 X-29.9042 Y56.1706 M98 P6

N4262 G80

N4264 M09 M13

N4266 M05 M16

N4268 G28 Z0 H0

N4270 G28 X0 Y0

N4272 G00 Z.2

N4274 M02

:6

N4300 T231 H231

N4310 M08 M12

N4320 S1180 F4.5 M03

N4330 G00 Z.1

N4340 G99 G73 Z-1.001 Q.045 J0.015 D0 R.050

N4350 G80

N4360 T236 H236

N4370 G96

N7380 G99 G81 Z-1.030 R1.600 F6.0

N7390 G80 G97 M16

N7400 M99

%

 

There was about 10,000 more points that were drilled in between there but you get the picture.

Essentialy, it was a program made for a special drill/boring tool that drilled the hole and then bored in one motion at different speeds, etc.

 

My problem is how I got my program to this point. I don't remember how I did it. I am doing another job that will use the same sub program with different points so I can copy my P6 sub program, but how did I get the "M98 P6" to output on every line? Normally these are not here. Generally, our work is limited to straight bolt circle drilling and simple mill programs.

Link to comment
Share on other sites

Not sure I understand the response. I just don't understand where and what I need to input to get the result I expect.

 

The following is from my post file which I am sure was altered when I did it the first time to allow me to call out the sub-programs.

 

 

Following Misc_Reals & Misc_Integers are used:

#

# mi2 - sub program usage (0=off, 1=on/reps)

#

# Options / Usage:

#

# mi1 - Output M0 Before Operation? (99=yes)

#

# WCS and Subs are limited to MAX of 12

#

# mi2.

# Sub Prog numbers are automaticly assigned in sequence starting at 1

# and increasing by 1 at every tool change.

# Main program number must be larger than than the number of tool changes.

#

#

# mi2 - sub program usage (0=off, 1=on/reps)

# - Example: If (3) entered then program begins with current wcs

# and generates (3) wcs calls

# Sample Main Output - G0G90G54X_Y_

# G43H01Z.1

# G54M97P__

# G55M97P__

# G56M97P__

# etc..

Link to comment
Share on other sites

This one controls workoffsets by mi2.

 

code:

 # mi2 - sub program usage (0=off, 1=on/reps)

# - Example: If (3) entered then program begins with current wcs

# and generates (3) wcs calls

# Sample Main Output - G0G90G54X_Y_

# G43H01Z.1

# G54M97P__

# G55M97P__

# G56M97P__

# etc..


I'm a little confused by this statement:

quote:

# Main program number must be larger than than the number of tool changes.

#


Looks like your post has been altered if it actually did work like you want. Or maybe you have some sort of C-hook to do this.

Link to comment
Share on other sites

quote:

It looks to me that you are using two tools, 231 and 236? Is this correct?


He says:

 

quote:

Essentialy, it was a program made for a special drill/boring tool that drilled the hole and then bored in one motion at different speeds, etc.


I see the tool calls and H calls, but no tool change. Looks like you're using H value to control depths.

 

I think this would be easier as a macro sub call instead. That way, you can still use your post and use the 'P6' sub as a "can cycle". Something like:

 

code:

 

:001111

N100( NAME - 4110)

N102( DATE - 03-21-02)

N104 ( START TOOL LIST )

N106 ( T01 1-1/4 DRILL )

N108 ( T01 MAX DEPTH -1.1255 )

N110 ( END TOOL LIST )

 

N112 ( ZONE 1 )

N114 G20

N116 G80

N118 G90 G97

N120 G28 X0 Y0 Z0 H0

N122 G00 Z.2

N130 G54 P6

N132 G00 X60.8125 Y14.1824

N134 G65 P6 (sub call for cycle)

N136 M98 P7 (create this sub for the 10,000 hole positions)

N138 G67 (cancel macro call)

N4264 M09 M13

N4266 M05 M16

N4268 G28 Z0 H0

N4270 G28 X0 Y0

N4272 G00 Z.2

N4274 M02


I have many parts I do with thousands of holes using several tools in the pattern. This is easier to track for me and I can use the same "hole pattern sub" for all tools.

 

cheers.gif

Link to comment
Share on other sites

There is no tool change. The two tool numbers are to because the tool has two cutting areas (drill and bore). We pick up a different tool height, speed, feed, and cycle.

 

On my program before, I had the M98 P6 on every hole position line. So far, I can't replicate that. I thought I just needed an number in the mi2 position on my parameters. Doesn't seem to accomplish that. How do I get my M98 P6 on each line?

 

You suggested this:

 

N130 G54 P6N132 G00 X60.8125 Y14.1824N134 G65 P6 (sub call for cycle)N136 M98 P7 (create this sub for the 10,000 hole positions)N138 G67 (cancel macro call)

 

Does that second sub program (P7) call out the other sub for every hole position?

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