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:

Forced post exit?


chris m
 Share

Recommended Posts

I have a couple of posts that I've edited to utilize misc int and misc reals for important variable setting data in the posted code. If values are outside of a certain range I have an error pop up on the MC screen, but the program will then post anyway.

 

Is there a way to cause the post to stop running and not save the .nc file when an error occurs?

 

Something like this:

 

if mach_ltr > four | mach_ltr < one,

[

result=mprnt[smacherror]

--->STOP HERE<---

]

 

Any help greatly appreciated

 

NOTE: parentheses shown wrong because I keep getting an error on this website with the real ones?

 

 

Thanks

 

C

 

[ 06-06-2003, 09:31 AM: Message edited by: chris m ]

Link to comment
Share on other sites

Chris- not sure if this is what you are after, but might be close.

 

You can exit a postline by using ex.

 

if mach_ltr > four | mach_ltr < one,

[

result=mprnt[smacherror],ex

 

But I think it will go to the next set of NCI lines and continue.

 

Something else is a warning statement similar to what I use for an overtravel on a 5x machine

 

if aout > 10,

[

"****************************************",e

"Warning! A axis has exceeded its limits!",e

"****************************************",e

 

It will continue the post, but when you see this in the code, obviously something needs to be fixed.

 

HTH

Jeremiah

Link to comment
Share on other sites

quote:

You could, gulp, induce a false error..

I don't completely understand you here. Keep in mind, of course, that I'm not particularly savvy with computer programming stuff (most of the stuff you say when you guys really start going is Greek to me); but the posted file is SERIOUSLY flawed if these values are not entered in MC. I have an error message on the screen, one gets posted in the file that will alarm the machine similar to what Jeremiah said, etc, but I'd still like to have it just quit posting if I could.

 

I'll try what perfecseal said and check back

 

Thanks guys

 

C

Link to comment
Share on other sites

The false error is what perfecseal showed you in "[smacherror]".

 

Try that, but I don't think it will 'quietly' stop posting. You'll get an error message, and possibly a partial nc file. At least you'll know. biggrin.gif

 

'Rekd teh Who's buying drinks after work???

Link to comment
Share on other sites

"exitpost" has to be in one word, not in two words as mankato wrote it, and that will cause the post to exit with a partial NC file, as mankato wrote.

 

It may be possible to set up your post so this partial NC file is obviously useless, by making it come out with only the file header, and a (probably incomple) tool list if you use a tool list in the NC program. This can be done by checking the values of the misc. integers and reals in the pwrtt postblock.

 

It may also be possible to make it come up with an empty NC file or no NC file at all, but that depens on whether the ppost postblock is called when the post exits on an exitpost command, and if no NC file at all is desired, how Mastercam reacts when it tries to open the NC program, and the NC file is no longer there. I don't remember the necessary file manipulation commands for that, but I could try to find out if necessary.

  • Like 1
Link to comment
Share on other sites

Christian

 

Thanks, I'll try the exitpost and see what she does; a partial file would probably be OK, depending on where it dies.

 

Rekd

 

I'm buying, too bad you're 3000 miles away; if you're ever in town, Brendan and I will surely stake you to a couple rounds cheers.gif

Link to comment
Share on other sites

It dies at whatever point that check makes it hit the exitpost command.

 

If you can make that happen in the pwrtt postblock as I mentioned above, then you will only get the file header and possibly a bit of tooltable.

 

If it happens at a toolchange, then it dies at that toolchange, before the code for machining the operation in question is output.

 

It will definitely happen before the eof code is written to the NC program, so your control might well give an alarm when you try to transfer the program to the control (though that might be a bit late for comfort).

Link to comment
Share on other sites

If you want to get rid of the partial file you might try this

 

---------------------------------------

pexpost #Exit post on error

_serrortmp = soperation + sspace + no2str(opnumber) + sexitpost

_errormsg = mprint(serrortmp)

_stemp = spathnc + snamenc

_stemp = stemp + sextnc

_result = fclose(stemp)

_result = remove(stemp)

---------------------------------------

 

I use this postblock to report an error and exit posting. It seems to still process after its called, but will remove the partial file out of the active directory (the dir you posted to) when finished. - I havent been able to remove the file when using exitpost.

Hope this helps.

 

Jason Tollefsen

 

[ 06-06-2003, 03:33 PM: Message edited by: Altek ]

Link to comment
Share on other sites

Looks like Altek had the file opoerations I couln't remember. To make the post procesosr exit when it encounters the error (no sense wasting time processing after that) without an NC file, the following should work:

 

code:

if mach_ltr > four | mach_ltr < one,

[

result = mprint(smacherror)

stemp = spathnc + snamenc

stemp = stemp + sextnc

result = fclose(stemp)

result = remove(stemp)

exitpost

]

That is assuming Mastercam does not complain about the NC file not being there, when it tries to open the NC file after post processing, but from what Altek wrote, it doesn't sound like that happens.

 

It might be even better if the post processor does create a NC file, with the only contents of the NC file being the error message. That way the user dosn't sit there wondering what happened to the NC file, after having hit 'Enter' without reading what the error message was about.

 

Addendum: So that is what you guys meant about an error message when using parentheses...

 

Enclosing the code in the 'code' HTML tags solves that problem.

Link to comment
Share on other sites

"That is assuming Mastercam does not complain about the NC file not being there, when it tries to open the NC file after post processing, but from what Altek wrote, it doesn't sound like that happens."

 

Christian/Chris, Its been a while since I made that postblock - I think thats why I had to let it finish processing, If memory serves me right MC left the .err file behind (or maybe both .err & .nc) when I added 'exitpost' on the end like Christian wrote.

 

good luck.

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