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

I'm not sure about you guys, but I tend to overlook simple, but critical details when I am programming. Some of my most common oversights are forgetting to turn on the coolant, and making sure that H and D outputs are appropriate for the tool. As a safeguard against my scatter-brained behavior, I have built a safety net into my post that will notify me that I have overlooked something. I will share this safety net for any of you that have an interest.

 

When posting, as each toolpath operation is processed, the post checks for any common errors that I have designated. If any are found, a popup box appears notifying the toolpath number, tool description and the error encountered.

 

The core of this feature is the popup box. You will need to add an entire postblock like this:

ptlchg_errorpop #Pop-up common toolchange errors
 if DepthCuts = 0,
	 [
	 if NumEntities = 1, errorcheck = 1
	 else, errorcheck = 3
	 ]
 else, errorcheck = 3
 if tloffno$ <> t$ & tloffno$ <> zero, [if mprint(stooldiameteroffserror, 2) = 2, exitpost$] #Diameter
 if tloffno$ = zero, [if mprint(stooldiameteroffszeroerror, 2) = 2, exitpost$] #Zero Diameter
 if tlngno$ <> t$ & tlngno$ <> zero, [if mprint(stoollengthoffserror, 2) = 2, exitpost$] #Length
 if tlngno$ = zero, [if mprint(stoollengthoffszeroerror, 2) = 2, exitpost$] #Length
 if coolant$ = zero, result = mprint(scoolantisoffserror, 1) #No Coolant

The strings that contain the text in the boxes are defined like this:

# --------------------------------------------------------------------------
# Error Checks
# --------------------------------------------------------------------------
sOpSeqNo	 : "" #Operation manager displayed operation number
stoollengthoffserror = "Operation " + sOpSeqNo + ": " + "(" + s20001 + ") TOOL LENGTH OFFSET DOES NOT MATCH TOOL NUMBER"
stoollengthoffszeroerror = "Operation " + sOpSeqNo + ": " + "(" + s20001 + ") TOOL LENGTH OFFSET IS ZERO"
stooldiameteroffserror = "Operation " + sOpSeqNo + ": " + "(" + s20001 + ") TOOL DIAMETER OFFSET DOES NOT MATCH TOOL NUMBER"
stooldiameteroffszeroerror = "Operation " + sOpSeqNo + ": " + "(" + s20001 + ") TOOL DIAMETER OFFSET IS ZERO"
scoolantisoffserror = "Operation " + sOpSeqNo + ": " + "(" + s20001 + ") COOLANT IS TURNED OFF"
serrordetect = "POTENTIAL OFFSET AND/OR COOLANT ERRORS DETECTED. NOTIFY?"
s20001 : "" #String for tool description
s20002 : "" #String for tool description

 

And finally, since I have jobs that I intentionally leave the coolant off, I created an escape route from the parade of popups, like this:

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

This creates a single popup that notifies me that errors were found. Do I want to see them?

 

Now, to make this work, you need to:

1. In the pparameter$ section, add this:

if prmcode$ = 15084, NumEntities = rpar(sparameter$, 1)
if prmcode$ = 15211, DepthCuts = rpar(sparameter$, 1)
if prmcode$ = 15240, sOpSeqNo = sparameter$	 #This is the operation manager operation number
if prmcode$ = 20001,
 [
 s20001 = sparameter$
 s20002 = sparameter$
 ]

2. In the variable format area, add this:

fmt	 4 errorcheck #Flag for error notification
fmt	 4 NumEntities #Flag for Contour Chains
fmt	 4 DepthCuts #Flag for Depth Cuts

 

3. In the psof$, ptlchg0$, and ptlchg$ sections, add this near the top:

 ptlchg_errorcheck #Check for common toolchange errors

 

Note: Some of the popups have one option, and some have two. On major errors, I have assigned the second button to exit the post.

 

I have tried to thumbnail an image of a coolant popup, without success. So, I have attached a PDF of the image here:

 

 

Works great thanks. Is there a way to turn off the coolant reminder?

Link to comment
Share on other sites

Works great thanks. Is there a way to turn off the coolant reminder?

 

In

 

ptlchg_errorpop #Pop-up common toolchange errors

 

comment out

 

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

 

in

 

ptlchg_errorcheck #Check for common toolchange errors

 

remove the following

 

| coolant$ = zero

 

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

 

so it looks like this:

 

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

  • Like 1
Link to comment
Share on other sites

Okay, I already found out how to turn it off already by changing 2 to 0

 

ptlchg_errorpop #Pop-up common toolchange errors

errorcheck = 1

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

if tloffno$ = zero, [if mprint(stooldiameteroffszeroerror, 2) = 2, exitpost$] #Zero Diameter

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

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

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

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

 

 

ptlchg_errorcheck #Check for common toolchange errors

if errorcheck = 0,

[

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

if result = 1, errorcheck = 1

if result = 2, errorcheck = 2

]

if errorcheck = 1, ptlchg_errorpop

 

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

# Tool Comment / Manual Entry Section

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

 

 

======================

My other question is, is that possible that I can make it notify for depth cuts and multi-passes? Or confirming the Z-depth? I know it is may be too much for but for future reference in case we may need them in the future.

Link to comment
Share on other sites

For some reason I am getting post errors now I am sure its something I did.

 

27 Aug 2013 07:06:41 AM - <2> - PST LINE (2015,2015) - The function can not be nested in a formula[36]

27 Aug 2013 07:06:41 AM - <2> - PST LINE (2016,2016) - The function can not be nested in a formula[34]

27 Aug 2013 07:06:41 AM - <2> - PST LINE (2016,2016) - The variable/string declaration is a duplicate, , Duplicate assignment of label

27 Aug 2013 07:06:41 AM - <2> - PST LINE (2017,2017) - The variable/string declaration is a duplicate, , Duplicate assignment of label

27 Aug 2013 07:06:41 AM - <2> - PST LINE (2018,2018) - The variable/string declaration is a duplicate, , Duplicate assignment of label

27 Aug 2013 07:06:41 AM - <2> - PST LINE (2015,2015) - The math calculation/formula has an error

Link to comment
Share on other sites

For some reason I am getting post errors now I am sure its something I did.

 

27 Aug 2013 07:06:41 AM - <2> - PST LINE (2015,2015) - The function can not be nested in a formula[36]

27 Aug 2013 07:06:41 AM - <2> - PST LINE (2016,2016) - The function can not be nested in a formula[34]

27 Aug 2013 07:06:41 AM - <2> - PST LINE (2016,2016) - The variable/string declaration is a duplicate, , Duplicate assignment of label

27 Aug 2013 07:06:41 AM - <2> - PST LINE (2017,2017) - The variable/string declaration is a duplicate, , Duplicate assignment of label

27 Aug 2013 07:06:41 AM - <2> - PST LINE (2018,2018) - The variable/string declaration is a duplicate, , Duplicate assignment of label

27 Aug 2013 07:06:41 AM - <2> - PST LINE (2015,2015) - The math calculation/formula has an error

 

I'm more than happy to take a look... I don't know what else you've programmed in you're post so you'll have to e-mail me te .pst file.

  • Like 1
Link to comment
Share on other sites

I was getting the missing coolant only in the 1st op only also.so instead of putting the

ptlchg_errorcheck in the psof,ptlchg,ptlchg0.i put the ptchg_errorpop,and that worked

For me,but if you have multipass or depthcuts on you'll get the warning multiple times.

Im good with that.

 

Link to comment
Share on other sites

Tired of loosing your settings in the control def?

 

With the pprep post block, you can make certain that the settings are always correct.

 

 

pprep$ # overide setting from control def

usecandrill$ = 1 # Use canned cycle for drill

usecanpeck$ = 1 # Use canned cycle for Peck

usecanchip$ = 1 # Use canned cycle for Chip Break

arctype$ = 2 #Arc center 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc.

breakarcs$ = 0 #Break arcs, 0 = no, 1 = quadrants, 2 = 180deg. max arcs

arcoutput$ = 0 #0 = IJK, 1 = R no sign, 2 = R signed neg. over 180

do_full_arc$ = 0 #Allow full circle output? 0=no, 1=yes

helix_arc$ = 2 #Support helix arc output, 0=no, 1=all planes, 2=XY plane only

omitseq$ = yes$ #Omit sequence no.

bldnxtool$ = 1

Link to comment
Share on other sites

Tired of loosing your settings in the control def?

 

With the pprep post block, you can make certain that the settings are always correct.

 

 

pprep$ # overide setting from control def

usecandrill$ = 1 # Use canned cycle for drill

usecanpeck$ = 1 # Use canned cycle for Peck

usecanchip$ = 1 # Use canned cycle for Chip Break

arctype$ = 2 #Arc center 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc.

breakarcs$ = 0 #Break arcs, 0 = no, 1 = quadrants, 2 = 180deg. max arcs

arcoutput$ = 0 #0 = IJK, 1 = R no sign, 2 = R signed neg. over 180

do_full_arc$ = 0 #Allow full circle output? 0=no, 1=yes

helix_arc$ = 2 #Support helix arc output, 0=no, 1=all planes, 2=XY plane only

omitseq$ = yes$ #Omit sequence no.

bldnxtool$ = 1

 

Why not just set the Control Definition Default values, and never have a setting be wrong again?

Link to comment
Share on other sites

Updates, moving files to different locations / computers.

It is my experience that the settings in the control file are easily lost.

 

Maybe I am the only one with this problem.

 

Hi Brian,

 

I am well aware of the issues people have. The reason your settings change is because you never set the Control Definition Default values. These are the values that get set every time you move/update a Control Definition file.

 

When you link a Post Processor (in a specific folder location) to a Control Definition and make changes (arc settings, files, tool settings, ect.), those changes are only made for that specific post, in that specific folder location.

 

After you get your Control Definition setup the with the settings you like, it is important to select the "Default Settings for Control Type" in the post processor drop-down menu. When you do this, it brings up the same "Topics" pages, but with the DEFAULT settings. If you change the Default values with "Default Settings for Control Type" set, those are the settings that will get read every time you update/move the Post file.

 

This is the single most overlooked piece of the Control Definition file. The problem is that people just don't know about it, or they forget to make these changes.

 

I think we've published information on setting the Control Definition Defaults in several different places. I'll see if I can figure out where this documentation is available...

 

Thanks,

 

Colin

Link to comment
Share on other sites

Hello Bryan,

 

I hope I didn't come off as rude by what I said. I was just trying to let everyone know that there is a relatively easy fix to the issue that has been around since X was first released. I think it is really more of a training or documentation issue than anything.

 

I did speak with the Developer that maintains the Control Definition module. I've requested an option be added to the CD logic, so that the Dialog will prompt you when saving the Control Definition, and ask you if you want to update the Default Values to match the changes you just made. I think that will go a long way towards solving this issue for the average user, who just isn't familiar with how the Default Settings are managed...

 

Thanks for mentioning this though and hopefully we can find a solution to this problem for all Mastercam users.

 

Best regards,

 

Colin

Link to comment
Share on other sites

Colin,

Your comments are well received, and appreciated.

In regard to changes to control def, my suggestions are:

 

1. Chance for only single page. (No need for prompt)

2. Remove file and path names from both machine and control files. Require that all 3 files simply be same name and located in same folder. Users can move them to any location, and rename without need to edit and link the 3 files back together.

 

I would be interested to know how many users maintain control definitions that have multiple pages.

I understand the attraction of a GUI interface to the posts, but we need to be careful that its implementation does not take away from stability.

 

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

We are running into problems that the TOP OF STOCK, SOMETIME PEOPLE FORGOT TO CHECK and we scrapped an expensive part. Is there away we can write a function that checks the TOP OF STOCK under the LINKING PARAMETERS? Please look at the image. Thanks a lot.

 

 

Suppose the TOP OF STOCK = -1.100 and the DEPTH = -1.757

 

and someone made mistake and put the TOP OF STOCK = -2.000 and the DEPTH is okay = -1.757

 

I would like MasterCam alarms us just like the one it checks COOLANT, CUTTER COMP AND TOOL LENGTH OFFSETS. Thank you for all of you guys help.

 

 

N20(8X HEL-TRONIC, #10-32 X .380)

G0 G17 G40 G49 G53 G80 G90 Z0

T20 M6(#10-32 STI HI-SPIRAL CUT TAP)

G0 G90 G54

X0. Y-4.815 S320 M3

G43 H20 Z.1 T16 M8(DOC= Z-1.857)

M135 S320

G98 G84 Z-1.757 R-2.000 F10. --------------------------> WRONG ARE VALUE base on TOP OF STOCK VALUE GIVEN...

X3.4047 Y-3.4047

X4.815 Y0.

X3.4047 Y3.4047

X0. Y4.815

X-3.4047 Y3.4047

X-4.815 Y0.

X-3.4047 Y-3.4047

G80 M9

M5

post-40265-0-20899900-1379431734_thumb.jpg

Link to comment
Share on other sites

The variable drl_sel_tos$ contains the distance from the Z depth of the cycle to the top of stock. If the top of stock is below the depth as your example shows, drl_sel_tos$ will be a negative value. So, you could write logic that checks to make sure drl_sel_tos$ > 0. If drl_sel_tos$ < 0, then error.

Link to comment
Share on other sites

It is not in the post yet. You need to write the code that evaluates this variable and the others listed above. If I was editing this in, I would put the code in pdrlcommonb.

 

Like this:

 

pdrlcommonb
 if drl_sel_tos$ < 0, [if mprint(sdrillerror, 2) = 2, exitpost$]

 

You will need a separate line like that for each of the above variables. You will also need to define the string that you want output if the error occurs.

 

HTH

Link to comment
Share on other sites

You are trying to do a calculation that is already done for you. drl_sel_tos$ = (top of stock) - (depth). This is already calculated inside the MP executable. All you need to do is evaluate what it is. If it is positive, top of stock is above depth. If negative, it is below depth. The formula I gave you is correct for drill cycles.

 

I will check into milling cycles to see if something can be done there.

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