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:

question about opcode$


Recommended Posts

When you are preparing to output code inside the Drill Cycle, the value of 'drillcyc$' is set. NCI G-code 81 is read at this point, and all the cycle parameters are available.

For 'opcode$', it will always be '3' when drilling.

Since you are looking at 'opcode$', my guess is that you want to "predict" what the next 'drillcyc$' variable value will be, and you probably want to test this at the 'Tool change' event. Am I right so far?

MP has a special mechanism called 'Get Next Op' that needs to be turned on. (This is on by default in almost every Generic Post). When this is enabled, MP will calculate the "next variable values" for you. This is a limited set of variables that allows you to get some of the "next operation's data". One of the things it "grabs" by looking ahead is the "Next Drill Cycle value".

The variable you want to test is 'nextdc$'. That will hold the value in the Drop-Down list for the Next Drill Cycle. Remember that this is a zero-based index. (1st item in the list is Drill Cycle 0, 2nd item is Drill Cycle 1, ect.)

  • Like 1
Link to comment
Share on other sites

Thanks gentlemen, I actually figured it out with some testing.  I formatted a statement and made it output after every op so that I could see the value.  

Colin, this is in regards to the post I mentioned to you that needs some love.  I'm trying to love on it a little.  I had a problem where Y axis output (only Y, not X) was not being output from drill op to drill op if they had the same Y value.  Not even on different planes.  I have not had parts repeat X values but even on a five sided part.  Imagine a perfect square, with a hole dead in the center of 5 sides.  If I drill the Top, Front, Back, Left and Right faces I only got Y output on the Top.  I was only seeing this with drill ops and only Y axis.  So I added [if opcode$ = 3, pfyout else, pyout] to my prapidout section.

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