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:

Make Your Post Catch Common Errors


Recommended Posts

You already helped me to figured it out for the

 

Let me know when will you come to San Jose, California or Oakland, San Francisco because I can drive to these 3 cities and have drinks with you

 

OK Then! :D:cheers:

 

So. As we did before, simply add basic tool variable (t$ as string) to the error string:

t$ is a numeric variable, we have to convert it to string with no2str() function

stoollengthoffserror = "Look for CUT# " + sOpSeqNo + ": " + "(" + s20001 + ") WRONG TOOL LENGTH OFFSET#, Suppose to match: " + no2str(t$)

 

You can do the same right here too:

stoollengthoffszeroerror = "Look for CUT# " + sOpSeqNo + ": " + "(" + s20001 + ") WRONG TOOL LENGTH OFFSET#, Suppose to match: " + no2str(t$)

 

And at cutter comp error strings:

stooldiameteroffserror = "Look for CUT# " + sOpSeqNo + ": " + "(" + s20001 + ") WRONG CUTTER COMP, Suppose to match: " + no2str(t$)
stooldiameteroffszeroerror = "Look for CUT# " + sOpSeqNo + ": " + "(" + s20001 + ") WRONG CUTTER COMP#, Suppose to match: " + no2str(t$)

Link to comment
Share on other sites

You know these procedures are GOLDEN like checking INITIAL HEIGHT, RETRACT HEIGHT,

Sure! After 10 years operating on different CNC machines and another 5 years with programming them, yes...

I know exactly what means a wrong sign before a simple number... ;)

 

 

USE CLEARANCE ONLY AT THE START AND END OF OPERATION

G89 OR G88 WARNINGS.

Do you mean G98/G99? Really good idea BTW. A little bit it's sound a factory specific stuff or a kind of "rote/habit".

But anyway, good idea and related with this topic too.

 

On the attached pic, do you wanna catch if one of the values under what you given?

Like a programming/factory standard?

 

Good idea, even if they are not very common, I mean not common generally, because it's not a T number or a D offset

those are common errors on CNC machines. But I can imagne that "Z" values are important standard in your shop.

 

I'll take a look, but tomorrow only, it's 23:58 in Hungary :D Don't say thanx, it's my hobby and with it I'm learning too. Don't forget my beer! ;):D

Link to comment
Share on other sites

This is what I got and I hope you'll like it.

 

# --------------------------------------------------------------------------

 

# Error Checks

# --------------------------------------------------------------------------

sOpSeqNo : "" #Operation manager displayed operation number

stoollengthoffserror = "CUT#" + sOpSeqNo + " *** WRONG TOOL LENGTH OFFSET" + " *** T" + no2str(t$)+ " *** H" + no2str(tlngno$) + " *** MUST BE H" + no2str(t$)+ " *** " + "(" + s20001 + ")"

sg53xyzerrorcheck = "Look for CUT# " + sOpSeqNo + ": " + "(" + s20001 + ") UNUSUAL G0 G53 XYZ VALUE IN HERE"

stoollengthoffszeroerror = "Look for CUT# " + sOpSeqNo + ": " + "(" + s20001 + ") WRONG TOOL LENGTH OFFSET#, Suppose to match: " + no2str(t$)

stooldiameteroffserror = "CUT#" + sOpSeqNo + "*** WRONG COMP" + " *** T" + no2str(t$)+ " *** D" + no2str(tloffno$) + " *** MUST BE D31+ *** " + "(" + s20001 + ")"

stooldiameteroffszeroerror = "Look for CUT# " + sOpSeqNo + ": " + "(" + s20001 + ") WRONG CUTTER COMP#, Suppose to match: " + no2str(t$)

scoolantisoffserror = "Look for CUT# " + sOpSeqNo + ": " + "(" + s20001 + ") NO COOLANT"

serrordetect = "Click OK to Q.C source program, click CANCEL to ignore"

 

sMyFancyDepthError = "WRONG TOP OF STOCK *** CUT# " + sOpSeqNo + " *** T" + no2str(t$) + " *** Z" + no2str(operation_depth) + " *** BUT TOP OF STOCK IS " + no2str(OpTopOfStock) + " *** " + "(" + s20001 + ")"

 

s20001 : "" #String for tool description

s20002 : "" #String for tool description

Tool.pdf

Link to comment
Share on other sites

This is what I got and I hope you'll like it.

 

Yeah, really good! ;)

 

If you wish to break the whole string into multiline string, for better appearance and visibility, you can add "enter" or

"carriage return" as an ASCII code with no2asc() function.

 

An example:

stooldiameteroffserror = "CUT#" + sOpSeqNo + "*** WRONG COMP" + " *** T" + no2str(t$)+ " *** D" + no2str(tloffno$) + no2asc(13) + " *** MUST BE D31+ *** " + "(" + s20001 + ")"

 

Now your error message will be multiline always.

Link to comment
Share on other sites

OK, here is my idea to catch few things in OPs:

 

We need some variables:

OpClrPlane  : 0  # Operation Clearance plane
OpRtrPlane  : 0  # Operation Retract plane
OpFeedPlane  : 0  # Operation Feed plane
OpClrPlane_ON : no$ # Operation Clearance plane set or not
OpRtrPlane_ON : no$ # Operation Retract plane set or not
OpClrPlane_min : 10 # Operation Minimum Clearance value - SET MINIMUM HERE
OpRtrPlane_min : 5  # Operation Minimum Retract value - SET MINIMUM HERE
OpFeedPlane_min : 2  # Operation Minimum Feed value - SET MINIMUM HERE

 

 

Need to catch some values from OP parameters @ pparameter$ postblock:

if prmcode$ = 10020, OpClrPlane = rpar(sparameter$, 1) # Operation Clearance plane
if prmcode$ = 15374, OpRtrPlane = rpar(sparameter$, 1) # Operation Retract plane
if prmcode$ = 10024, OpFeedPlane = rpar(sparameter$, 1) # Operation Clearance plane
if prmcode$ = 15100, OpClrPlane_ON = rpar(sparameter$, 1) # Operation Clearance plane set or not
if prmcode$ = 15101, OpRtrPlane_ON = rpar(sparameter$, 1) # Operation Retract plane set or not

 

 

Create a individual postblock:

pCheckOpValues
     # Clearance plane
     if not(OpClrPlane_ON), if mprint("Clearance plane not set!!!", 2) = 2, exitpost$
     else, if OpClrPlane < OpClrPlane_min, if mprint("Clearance plane LOW!!!", 2) = 2, exitpost$
     # Retract plane
     if not(OpRtrPlane_ON), if mprint("Retract plane not set!!!", 2) = 2, exitpost$
     else, if OpRtrPlane < OpRtrPlane_min, if mprint("Retract plane LOW!!!", 2) = 2, exitpost$
     # Feed plane
     if OpFeedPlane < OpFeedPlane_min, if mprint("Feed plane LOW!!!", 2) = 2, exitpost$

 

 

Somewhere here insert the call of our pCheckOpValues postblock (3 times in your post I guess)

(the places where you check the OP depth)

#
"( DOC =", *operation_depth, ")", e$
if OpTopOfStock < operation_depth, [if mprint("Something is verrryyyy-verrryyyy wrooonnngggg", 2) = 2, exitpost$]
last_op_id = op_id$
pCheckOpValues 
#

Link to comment
Share on other sites

Is there away I can identify the Cut# for the toolpath like previous I did like

 

scoolantisoffserror = "CUT#" + sOpSeqNo + " *** NO COOLANT ***" + no2asc(13) + "TOOL#" + no2str(t$) + " (" + s20001 + ")" + no2asc(13) + no2asc(13) + "M9 *** IS WHAT YOU HAVE NOW"+no2asc(13)+"M8 *** IS WHAT USUALLY IT HAS IN THE TOOLPATH"

Link to comment
Share on other sites

Wow, Peter you really make my eyes bursting tears. You are so nice spend time for me.... Thank you...

No problem, glad to help! It's my hobby (and work will be) I have time in these days and I also learning with it.

But I just start to thinkin' to add a Donate button with PayPal in my signature.... :D:lol:

 

 

Is there away I can identify the Cut# for the toolpath like previous I did like

Sure... ;)

 

I'm sorry for being abused, I figured it out already. I will post the codes after I'm done. Thanks a million, Peter.

Yepp, so easy now! ;)

Link to comment
Share on other sites

Well, I got it and the forum is now only allowing me to upload 35.27K image size whereas my file size is 300K

 

Here is my codes

 

 

#Custom Defined Variables

operation_depth : 0 # Operation full depth

last_op_id2 : 0 # OP tracking ID

OpTopOfStock : 0 # Operation Top of Stock

 

OpClrPlane : 0 # Operation Clearance plane

OpRtrPlane : 0 # Operation Retract plane

OpFeedPlane : 0 # Operation Feed plane

OpClrPlane_ON : yes$ # Operation Clearance plane set or not

OpRtrPlane_ON : yes$ # Operation Retract plane set or not

OpClrPlane_min : 0 # Operation Minimum Clearance value - SET MINIMUM HERE

OpRtrPlane_min : 0 # Operation Minimum Retract value - SET MINIMUM HERE

OpFeedPlane_min : 0 # Operation Minimum Feed value - SET MINIMUM HERE

 

 

 

# --------------------------------------------------------------------------

# Error Checks

# --------------------------------------------------------------------------

sOpSeqNo : "" #Operation manager displayed operation number

stoollengthoffserror = "CUT#" + sOpSeqNo + " *** POSSIBLE WRONG TOOL LENGTH OFFSET ***" + no2asc(13) + "TOOL#" + no2str(t$) + " (" + s20001 + ")" + no2asc(13) + no2asc(13) + "H" + no2str(tlngno$) + " *** IS WHAT YOU HAVE, IT SHOULD BE *** H" + no2str(t$)

sg53xyzerrorcheck = "Look for CUT#" + sOpSeqNo + ": " + "(" + s20001 + ") UNUSUAL G0 G53 XYZ VALUE IN HERE"

stoollengthoffszeroerror = "CUT# " + sOpSeqNo + "POSSIBLE WRONG TOOL LENGTH OFFSET#"+no2asc(13)+"TOOL#"+no2str(t$)+" ("+s20001+")"+no2asc(13)+no2asc(13)+"H" +no2str(tlngno$)+" *** IS WHAT YOU HAVE NOW"+no2asc(13)+"H"+no2str(t$)+" *** IS WHAT YOU SHOULD HAVE"

stooldiameteroffserror = "CUT#" + sOpSeqNo + " *** POSSIBLE WRONG COMP ***" + no2asc(13) + "TOOL#" + no2str(t$) + " (" + s20001 + ")" + no2asc(13) + no2asc(13) + "D" + no2str(tloffno$) + " *** IS WHAT YOU HAVE NOW, IT SHOULD BE HIGHER THAN D30 ***"

scoolantisoffserror = "CUT#" + sOpSeqNo + " *** NO COOLANT ***" + no2asc(13) + "TOOL#" + no2str(t$) + " (" + s20001 + ")" + no2asc(13) + no2asc(13) + "M9 *** IS WHAT YOU HAVE NOW" + no2asc(13) + "M8 *** IS WHAT IT SHOULD BE"

serrordetect = "CUSTOM MASTERCAM AUTOMACTIC SOURCE Q.C FUNCTION" + no2asc(13) + no2asc(13) + "Click OK to Q.C source program" + no2asc(13) + "click CANCEL to ignore"

sOpClrPlane_ON = "CUT#" + sOpSeqNo + " *** CHECK LINKING PARAMETER PAGE"+no2asc(13)+no2asc(13)+"INITIAL Z CLEARANCE VALUE IS NOT SPECIFIED"

sOpRtrPlane_ON = "CUT#" + sOpSeqNo + " *** CHECK LINKING PARAMETER PAGE"+no2asc(13)+no2asc(13)+"INITIAL Z RETRACT VALUE IS NOT SPECIFIED"

sMyFancyDepthError = "CUT# " + sOpSeqNo + " *** POSSIBLE WRONG TOP OF STOCK" + no2asc(13) + "TOOL#" + no2str(t$) + " (" + s20001 + ")" + no2asc(13) + no2asc(13) + "SOURCE DEPTH IS Z" + no2str(operation_depth) + " *** TOP OF STOCK IS " + no2str(OpTopOfStock)

 

s20001 : "" #String for tool description

s20002 : "" #String for tool description

 

 

 

 

ptlchg_errorpop #Pop-up common toolchange errors

errorcheck = 1

if tloffno$ <> t$ & tloffno$ <30, [if mprint(stooldiameteroffserror, 2) = 2, exitpost$] #Diameter Doesnt Match T

if tlngno$ <> t$ & tlngno$ <> zero, [if mprint(stoollengthoffserror, 2) = 2, exitpost$] #Length Doesnt Match T

if xh$ <> zero | yh$ <> zero | zh$ <>zero, [if mprint(sg53xyzerrorcheck, 2) = 2, exitpost$] #G53XYZ

if tlngno$ = zero, [if mprint(stoollengthoffszeroerror, 2) = 2, exitpost$] #Zero Length

if coolant$ = zero, result = mprint(scoolantisoffserror, 1) #No Coolant

if OpTopOfStock < operation_depth, [if mprint(sMyFancyDepthError, 2) = 2, exitpost$]

if not(OpClrPlane_ON), [if mprint(sOpClrPlane_ON, 2) = 2, exitpost$]

if not(OpRtrPlane_ON), [if mprint(sOpRtrPlane_ON, 2) = 2, exitpost$]

 

ptlchg_errorcheck #Check for common toolchange errors

if errorcheck = 0,

[

if tloffno$ <> t$ | tlngno$ <> t$ | coolant$ = zero, result = mprint(serrordetect, 2)

if result = 1, errorcheck = 1

if result = 2, errorcheck = 2

]

if errorcheck = 1, ptlchg_errorpop

 

 

 

# --------------------------------------------------------------------------

# Start of File and Toolchange Setup

# --------------------------------------------------------------------------

psof0$ #Start of file for tool zero

psof$

 

psof$ #Start of file for non-zero tool number

ptlchg_errorcheck #Check for common toolchange errors

 

"(*)", e$,

comment$, e$

ptravel

pwritbuf5

pcuttype

toolchng = one

if ntools$ = one,

 

 

 

ptlchg0$ #Call from NCI null tool change (tool number repeats)

ptlchg_errorcheck #Check for common toolchange errors # This line will search for depth cuts and multi-passes

toolchng0 = one

[

rd_params$ # Read parameters - pparameter

pmisccheck

]

pcuttype

toolcount = toolcount + 1

if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)

else, nexttool = first_tool$

retractflg = 0

 

 

 

ptlchg$ #Tool change

ptlchg_errorcheck #Check for common toolchange errors

pcuttype

toolchng = one

toolcount = toolcount + 1

if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)

else, nexttool = first_tool$

if wcstype = one, #Work coordinate system

[

pfbld, n$, *sg28, "X0.", "Y0.", e$

pfbld, n$, "G92", *xh$, *yh$, *zh$, e$

]

pbld, *sg53, "Y0", e$

[if indx_out <>0, "A0.", else, ""], e$

if mi10$=one, n$, *sm00, e$

else, pbld, n$, *sm01, e$

comment$,e$

"(*)", e$

ptlchg_com

 

 

 

THANK YOU PETER, ALL OF THESE SAFETY CHECKS ARE MADE BY YOU. YOU HAVE SAVE MANY UNWELCOME FUTURE ACCIDENTS. OUR PEOPLE THANK ----- YOU THAT THEY ARE AT A SAFE WORK PLACE WITH THEIR HANDS AND LEGS AND FACE... AND... EYES BEING PROTECTED BY YOU.

 

I TRULY HONOR YOU AS MUCH AS I'M TREATING MYSELF GOOD.... THANK YOU FOR EVERYTHING ABOUT THIS SAFETY CHECKS.

  • Like 1
Link to comment
Share on other sites

Hi Peter,

How do I disallow the "DRILLING" toolpath not to check the RETRACT plane because it does not have a RETRACT feature. Can you assist me? Thank you.

 

PS: The milling function of RETRACT check is good but not the drilling function since they don't have that function included.

 

 

 

Thanks,

S.Luong

Link to comment
Share on other sites

How do I disallow the "DRILLING" toolpath not to check the RETRACT plane because it does not have a RETRACT feature.

 

You can check the type of operation, in your ptlchg_errorpop postblock change the last line to this:

if not(OpRtrPlane_ON) & opcode$ <> 3, [if mprint(sOpRtrPlane_ON, 2) = 2, exitpost$]

 

;)

Link to comment
Share on other sites
  • 2 weeks later...

Is there a way...

 

Yes. Always almost... ;)

 

Is there away I can call out PASSES, SPACING, SPRING PASSES, STEP OVER PERCENTAGE, STEP OVER DISTANCE, values in the 2D TOOLPATHS - POCKET so I can remind my programmers what they did wrong?

 

Need to define EXACTLY what we want. Error check during post? List from these values in header section of NC code?

List from these values at tool changes in NC code?

Check and compare values to given Min/Max values?

Link to comment
Share on other sites

one of the biggest problem that we are crazy about is the OPERATOR try to PROVE the G-CODES and back up to the system without updating the source. Therefore, I would like to define those fields and get ready for the bad days.

 

Is there away we can ask the post processor will do a comparing file right after we post? I think it would be tough but would be much more less crap parts...

Link to comment
Share on other sites
  • 1 year later...

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