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:

Custom Sub Programs Posting to End of Program


huskermcdoogle
 Share

Recommended Posts

Guys,

 

We have an FMS, and probe about 80% of the parts we run in it (Flimsy Aluminum Casting Work). Anyway, I hate editing code and do as little as possible, but one things that I always do is write all of my probing cycles by hand because there is hardly a single part that is cut and dry simple probing. I have heard and seen people use custom drill cycles to do probing, but have no interest in that, seems too cumbersome. Anyway, the way our system handles file transfer is to just bring in the programs(one file) and work offsets(single g10 file), then it calls the offset program and then calls the workpiece program. So what I end up doing is I toss the probing subroutine in the end of the program file after the M30 and all is cool, it gets into the control anyway. I then use a subprogram call (drill cycle) to put the probe in the spindle and call the length offset, then call my probing sub.

 

Long Story Short.

 

Is there a way to use Manual Entry to toss a chunk of code after the M30 so I don't have to paste in my sub after posting?

 

Thanks,

 

Nick

Link to comment
Share on other sites

You could use manual entry to output code. If it is a common file that you will use regularly write it in the editor and save it as a text file. When you open the manual entry set the source to "use text file" then go select it.

 

You'll want to set the NCI output as code, if you need any comments to be output you should have those in parenthesis when you save the text file.

Link to comment
Share on other sites

You could use manual entry to output code. If it is a common file that you will use regularly write it in the editor and save it as a text file. When you open the manual entry set the source to "use text file" then go select it.

 

You'll want to set the NCI output as code, if you need any comments to be output you should have those in parenthesis when you save the text file.

 

 

I use manual entry from time to time, but it won't insert it at the right place. It needs to be after my safe retract and pallet change prep M30 BS.

 

 

 

Husker

Link to comment
Share on other sites

hmm... maybe do it by a misc. integer?

 

This would go in your peof$ section:

 

If mi10 = one, n$, "CODE HERE", e$

 

 

Yeah I thought about that, but the problem I have is that the Manual Entry is an operation itself, so it won't do the EOF yet, and I can't edit my probing into my post, that wouldn't make any sense at all.

 

 

Husker

Link to comment
Share on other sites
If you are already using a custom drill cycle to load the probe and call a sub why not just edit the post to post probe routines. IMO it is much cleaner that way, no subs to worry about.

 

This the way we've handled it, custom drill cycles that call the probing cycle. If it is an InHouse post I'm sure you could get a quote to have probing cycles added.

Link to comment
Share on other sites

after manul entry

on post

n$, "M30", e$

comment$

mergesub$

clearsub$

mergeaux$

clearaux$

"%", e$

this will give after m3o the comments on manual entry codes

 

This sparked a good way to do it.... I have figured it out and added it into my post.

 

Basically you need to do the following things.

 

Define the variable "peofid" in the variable initialization section.

 

Then change the following sections:

 

Original:

peof$            #End of file for non-zero tool           
     phsm_off
     pbld, n$, "M09", e$
     pbld, n$, "M89", e$
     pbld, n$, "G91 G30", "Z0.", e$
     pbld, n$, "G30", "X0.", "Y0.", e$
     if lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
     rotretflg = 1
     pbld, n$, "G91", *sg28, protretinc, e$
     rotretflg = 0
     if lock_codes = one & rot_on_x, pbld, n$, *slock, slockcomm, e$
     comment$
     if not(index), n$, *sg90, e$
     n$, "M30", e$
     mergesub$
     clearsub$
     mergeaux$
     clearaux$
     "%", e$

 

 

add the "peofid = 1"

add "comment$" after the M30 and comment out the original "comment$

 

Modified:

peof$            #End of file for non-zero tool           
     phsm_off
  peofid = 1
     pbld, n$, "M09", e$
     pbld, n$, "M89", e$
     pbld, n$, "G91 G30", "Z0.", e$
     pbld, n$, "G30", "X0.", "Y0.", e$
     if lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
     rotretflg = 1
     pbld, n$, "G91", *sg28, protretinc, e$
     rotretflg = 0
     if lock_codes = one & rot_on_x, pbld, n$, *slock, slockcomm, e$
     #comment$
     if not(index), n$, *sg90, e$
     n$, "M30", e$
     comment$
     mergesub$
     clearsub$
     mergeaux$
     clearaux$
     "%", e$

 

Then change the following line in the manual entry section.

 

From:

if gcode$ = 1006, n$, pspc, scomm$, e$

 

To:

if gcode$ = 1006,
               [
	if peofid = 1,
		[
		" ", e$
		" ", e$
		n$, pspc, scomm$, e$
                       peofid = 0
		]
	else, n$, pspc, scomm$, e$
               ]

 

Good luck to anyone that may want to to do this.

 

 

Thanks Everyone,

 

Husker

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