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:

Defining the end of the program


Recommended Posts

I have a section in my post I created using mr4 to have the machine pull up & out of the way, so the operators can check that the 1st part is correct, before running our transform ops.

It works fine, except that it also outputs at the end of the program. I'm trying to figure out how to make it not do that. Is there a predefined variable that I can use to make something like this work?

pfirstarticle      if "this is the end of the program",      [       mr4$=0       ]       else,         n$, "G91 G28 Z0.", e$         n$, "G91 G28 C0. A0.", e$         n$, "G91 G28 X0.", e$         n$, "G91 X65.",e$         n$, "G90", pwcs, e$         n$, "M00", sopen_prn, "CHECK 1ST PART", sclose_prn, e$         mr4$=0     if tcp_enabled = 1,        [         penabletcp        ]
  • Like 1
Link to comment
Share on other sites

You need to put the same logic in the "M30" line of your post.

The snippet I posted is my whole postblock. I call pfirstarticle in my pretract postblock. My M30 call is in the peof$ section:

peof$            #End of file for non-zero tool                 toolchng = one      !gcode$ #to see that this is the EOF in pretract      n$, "G5.1 Q0", e$      if tcp_enabled = 1,           [            pdisableTCP           ]      map_mode = zero      pretract      prefreturn      ##### Custom changes allowed below #####      comment$      n$, "M30", e$      "%", e$

I'm not clear on how I could make the logic work there.

Link to comment
Share on other sites

Okay the logic you used in pretract to call pfirstarticle you use to end the process the way you want for you need. The idea is what you use for one is the same trigger for the other, but to create output you want for the process to not happen. You have created logic to get output you want so now use the same logic to not get output you want.

Link to comment
Share on other sites

Okay the logic you used in pretract to call pfirstarticle you use to end the process the way you want for you need. The idea is what you use for one is the same trigger for the other, but to create output you want for the process to not happen. You have created logic to get output you want so now use the same logic to not get output you want.

Ok, I got it. But now I see that this might be a better fit as a cantext setup.

 

Thanks Ron

Link to comment
Share on other sites

if nextop$ = 1003

 

That is the typical code to check for the end of the program. But you can only get that value at the "last tool change".

 

With your original code example above, you would need to "wrap" the 'else' condition with a pair of square brackets, since you want to output multiple lines of code, when the 'if' condition is false.

  • Like 1
Link to comment
Share on other sites

if nextop$ = 1003

 

That is the typical code to check for the end of the program. But you can only get that value at the "last tool change".

 

With your original code example above, you would need to "wrap" the 'else' condition with a pair of square brackets, since you want to output multiple lines of code, when the 'if' condition is false.

Awesome! This worked perfectly.

Thanks yet again Colin, you are one of this forums greatest resources.

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