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


D Humphreys
 Share

Recommended Posts

i think this is it in the post +1000 to main program number

 

psub_call_s$ #Call to sub level

result = nwadrs(strp, sub_prg_no$)

sub_prg_no$ = sub_prg_no$ + sav_progno + 1000 #Add sub number offset

if sav_progno = sub_prg_no$, result = mprint(sprgnerror)

pbld, n$, "M98", *sub_prg_no$, e$

Link to comment
Share on other sites

[CHIME IN]

 

HUMPHER_D:

 

smile.gif The answer to your question is yes (sort of) LOL smile.gif

 

Mastercam auto sub support is only limited to how complicated you want to make the solution.

 

Subs can be classified into three categories:

 

1.Transform subs

2.Non-transform subs

3.User defined subs

 

As long as you only want to deal with the first two types things are fairly easy.

 

In the Mpmaster post, Mp.dll calls these two postblocks to output subs:

 

psub_call_trans - for transform operations

(linked from psub_call_m$ and psub_call_mm$)

(transform, mirror, and rotate)

 

and

 

psub_call_s$ - for non-transform operations

(drill subs & depth cuts)

 

main_prg_no$ - is the number assigned to each transform operation

 

and

 

sub_prg_no$ - is the number assigned to each non-transform operation

 

You can change the number each type starts at(offset), but they will increment by one each time a new sub is called.

 

By default Mpmaster starts transform subs at 1 + sav_progno(the program number you input in mastercam) and non-transform subs at 1000 + sav_progno.

 

Keep in mind that there needs to be a number or variable that offsets the main from the sub numering to avoid conflict, and it must be a static value to allow the sub to be recalled in a further operation. For example if the same drill points are picked in multiple operations(in the same order), they will share the same sub, rather than creating a new one.

 

If you play by these rules you should be safe.

 

If you need to do more than this I would suggest leaving it to the pros, or get real familiar with the Mp Post Reference Guide.

 

 

[/CHIME OUT]

 

[ 01-17-2009, 05:55 PM: Message edited by: mastercamguru ]

Link to comment
Share on other sites

I don't know how much you know about the MP language, or how deep you are willing to dive into this, so I'll give you a few leads.

 

Post Reference Guide

 

If you are using X there is a pdf(Post Parameter Ref.pdf) in your mcamx/documentation directory that explains new post rules and parameter info.

 

 

I just posted a custom debug tool (for advanced post programming).

 

Sharing my new debugging tool

 

 

Just remember to back up your post before making changes!

 

HTH

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