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:

Retract at end of toolpath...


Recommended Posts

At the end of each toolpath, I'd like a "G53 Z0", but at the end of the program, I'd like it to be "G53 Y0 Z0".

 

I added the "G53 Z0" to the pretract$, and the "G53 Y0 Z0" to the peof$, but at the end of the program I now have a redundancy I'd like to get rid of..

 

(last toolpath)

(last toolpath)

(last toolpath)

G0 Z5.

M9

G0 G53 Z0<------- Would like removed

G0 G53 Y0 Z0

M30

%

 

How can I describe "If last toolpath, don't output this"?

 

Thanks!

Link to comment
Share on other sites

Define a new variable...(last one in the list for this example)

 


#Misc variables

lim_flg    : 0      #Flag to only output limit warning once
tilt_flg   : 0      #Flag to only output tilt limit warning once
hst_flg    : 0      #Flag to output HST comments
kunfused   : 0      #

 

 

Add the first line here in the peof postblock

 

peof$            #End of file for non-zero tool  
     kunfused = 1 		
     pretract
     if lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
     rotretflg = 1

 

 

Then use that as your "condition" for your new conditional statement inside your pretract postblock.... you will have to put it in as something like this

 

if kunfused = 1, 
[
pbld, n$, desired retract code for the end of file, e$
]
else, 
[
put normal (not eof) code here
       ]

Link to comment
Share on other sites

John,

 

Would it be better to

 

In the pretract section

 

 

if nextop$ = 1000 | 1001 | 1002,

[

pbld, n$, sg00, "G53", "Z0." e$

]

 

then in the

 

peof$

 

pbld, n$, sg00, "G53", "Y0", "Z0." e$

 

kunfuzed,

 

1003 is the g code in the NCI file that tells the post you are at the end of the file.

 

1000, 1001, and 1002 tell the post toolchange whether it is a new change or null.

 

Jerry

Link to comment
Share on other sites

as 1003 is only at the end of the file and that's where he needs the difference to show, that to me makes the most sense.

 

It surely isn't the only way to do it.

Link to comment
Share on other sites

Easiest to do:

 

pbld, n$, sg00, "G53", [if nextop$ = 1003,"Y0"], "Z0." e$

 

in pretract and nothing in peof$. We call that an "inline boolean".

 

You will see other examples of that type of thing in other output lines in modern posts (ie posts developed after X was released).

 

I should likely also point out that getnextop$ must be initialized to 1 in your post for the logic to work (should already be in your post but add it if it is not).

 

getnextop$ : 1 #Build the next variable table

  • Like 1
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...