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


bigprody
 Share

Recommended Posts

We are starting to use transform with subprograms for our multiple hit electrodes quite frequently. As things are now the subprogram numbers start at 11 and increment by 1. Is there a way to set that starting value inside of MC? We like to run our trodes at night and if we are to run more than one I need to do a bit of editing to the code.

 

 

Link to comment
Share on other sites

We are starting to use transform with subprograms for our multiple hit electrodes quite frequently. As things are now the subprogram numbers start at 11 and increment by 1. Is there a way to set that starting value inside of MC? We like to run our trodes at night and if we are to run more than one I need to do a bit of editing to the code.

If your subs already put out starting at 11, someone has already altered your post in some way

 

The default is adding 1000

 

SO I think before anyone can offer what you need to do, figuring out what's already been changed is going to be helpful

Link to comment
Share on other sites

OK, don't if this will help you but

 

This will allow you in the first operation to to set your desired sub# and increment value 

 

Created 3 variables

sof          : 1     #start of file flag
prog_inc_no  : -9999 #Subprogram increment value
sav_sub_no   : -9999 #Save the subprogram value

In the psof section I added

if sof, sav_sub_no = mr1$
if sof, prog_inc_no = mr2$

and at the end of the psof section

sof = 0

Then in the section

 

psub_call_trans #Translate level calls from toolchange, user

if progno$ = main_prg_no$, result = mprint(sprgnerror)
main_prg_no$ = sav_sub_no  <------------------added this line
sav_sub_no = main_prg_no$ + prog_inc_no   <---added this line
pbld, n$, "M98", *main_prg_no$, e$
prv_feed = c9k #Force feed in sub

and I added this int he Control def section

[misc reals]
1."Initial SUB #"
2. Sub Increment"

2014-10-30_14-41-17_zps057d2ee1.jpg

 

 

That lets me set the first sub# to 2500 and increment by 10

 

So I got

 

2500

2510

2520 

2530

2540

 

You can alter the values to your taste

 

hth

Link to comment
Share on other sites

I figured it was a post thing, and I was going to have to use a Misc. Value, just thought I would check here first. Thanks John, your examples have got me on the right track.

 

Have you ever seen a smooth body of water and think I would row the $h!t out of that.

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