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:

drilling conditional test


Recommended Posts

So, I have a condition where I need to NOT output a spindle speed, M03, and Coolant on when using a custom drill cycle #9.

 

 

 

Here is the code I have:

 

pcan1, pbld, n$, *sgcode, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfcout, pfxout, pfyout,

[ if not(opcode$ = 3 & (drillcyc$ = 9)), pfspindleout], [if gcode$ = 1, *feed], strcantext, e$

 

 

 

Which I think SHOULD output 'pfspindleout' anytime EXCEPT when outputting a opcode$ = 3 AND drillcyc$ = 9.

But, what I find is that during the toolchange cycle, while opcode$ does equal 3, the drillcyc$ is 1.

 

 

How do i get the drillcyc$ to be what is called out in parameters during the toolchange? It is correct during the rest of the program, just not at program start, or toolchange.

 

 

 

Thanks

Link to comment
Share on other sites
Guest craig madsen

an example where drillcyc$ SHOULD BE 9, but isn't:

 

N1590 G0G90G17G54X-27.0Y22.

N1600 T22 M06 (9/16 STERLING GUN DRILL)

N1610 (MAX - Z.1)

N1620 (MIN - Z-7.45)

GOT HERE !!! opcode$ 3. drillcyc$ 1. (Printing opcode$ and drillcyc$ status)

N1630 G00 G17 G90 G55 X-4.25 Y0. S407 M03 (S407 M03 should not be output)

N1640 G43 H22 Z.1 T11

 

BUT, at the beginning of the program, where Drillcyc$ should be 2, it posts as:

 

N130 T9 M06 ( LTR. U GARR CARBIDE DRILL)

N140 (MAX - Z.1)

N150 (MIN - Z-1.086)

GOT HERE !!! opcode$ 3. drillcyc$ 9.

N160 G00 G17 G90 G54 X0. Y4.5

N170 G43 H9 Z.1 T11

N180 G94

N190 G98 G83 Z-1.086 R.1 Q.25 F1.02

 

I figured I would print examples of output - It has me stumped.

Link to comment
Share on other sites

To look ahead in the NCI file, you need to make sure the pre-defined variable 'getnextop$' is enabled (set to a value of '1').

 

This creates a table of "next variable values" that you can access.

 

Once the 'getnextop$' has been enabled, you can use the pre-defined variable 'nextdc$' to get the value of the next Drill Cycle.

 

At Toolchange, the 'nextdc$' variable should have a value of the Drill Cycle you set in the Toolpath Operation.

 

Keep in mind that the 'drillcyc$' variable uses an index of '0'. So a 'Simple Drill' routine is a 'drillcyc$' value of '0'. Peck is a 'drillcyc$' value of '1'.

 

So if you are using Custom Drill Cycle #1, the value is '8'. If you are using Custom Drill Cycle #2, then the value would be '9'.

 

Hope that helps,

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