Sign in to follow this  
opcode

M01 after every OP

Recommended Posts

How do I insert M01 for postprocessor?  optional stop after every operation for the SAME tool, without keying it into the code? (Manual Entry)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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 .

Share this post


Link to post
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.

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • 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