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:

M01 after every OP


Recommended Posts

The op_id$ value is the key to this.  op_id$ is the unique identifier for an operation in the Mastercam database.

There is more than one way to do this.  I typically set up a boolean constant called is_new_op that checks the value of op_id$ to the prv_op_id$.  Then in the null tool change postblock I use is_new_op to determine whether or not to output the op stop code. Some pseudo code below

  1. is_new_op = fsg(op_id$ <> prv_op_id$, yes$, no$)
  2.  
  3. ptlchg0$
  4.     if is_new_op, "M01", e$
  5.     !op_id$

Depending on how your post is setup you may have to change when op_id$ is updated with the '!' modifier.

Link to comment
Share on other sites
4 hours ago, jeff.D said:

...Some pseudo code below

  1. is_new_op = fsg(op_id$ <> prv_op_id$, yes$, no$)
  2.  
  3. ptlchg0$
  4.     if is_new_op, "M01", e$
  5.     #!op_id$ - this in incorrect, see below.

I realized after posting that updating op_id$ in null tool change will not work.

  1. is_new_op = fsg(op_id$ <> prv_op_id$, yes$, no$)
  2.  
  3. ptlchg0$
  4.     if is_new_op, "M01", e$
  5.  
  6. ptlchg$
  7.     !op_id$

Depending  on how your post is setup you may have to change  w h en op_id$ is updated with the '!' modifier .

Link to comment
Share on other sites
6 hours ago, jeff.D said:

I realized after posting that updating op_id$ in null tool change will not work.

  1. is_new_op = fsg(op_id$ <> prv_op_id$, yes$, no$)
  2.  
  3. ptlchg0$
  4.     if is_new_op, "M01", e$
  5.  
  6. ptlchg$
  7.     !op_id$

Depending  on how your post is setup you may have to change  w h en op_id$ is updated with the '!' modifier .

Hello Jeff.D,
  I would like do to this as "M0" instead of "M01", is that possible?

====================
If previous OP_ID$ is MANUAL ENTRY DATA AS CODED, then output "M0" instead of "M01".

Is that possible, Jeff.D?

 

Thank you for sharing.

Link to comment
Share on other sites
9 hours ago, jeff.D said:

I realized after posting that updating op_id$ in null tool change will not work.

  1. is_new_op = fsg(op_id$ <> prv_op_id$, yes$, no$)
  2.  
  3. ptlchg0$
  4.     if is_new_op, "M01", e$
  5.  
  6. ptlchg$
  7.     !op_id$

Depending  on how your post is setup you may have to change  w h en op_id$ is updated with the '!' modifier .

Hello,Jeff.D

          When I  edit it ,  I find it is difficut to me for completing the "M01", I get some err. How to get it ,I want to get the result.

Thank you for  helping!

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