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:

post errors - message explanation?


Lucky
 Share

Recommended Posts

My post editing skills have become rusty. I'm putting some logic into my post to handle tool breakage detection but the log file has errors and the output is not right. The behavior I'm looking for is:

 

If misc. real 7 = 1, then during a tool change run the breakage detection cycle on the previous tool. If the check fails then stop (M00). If misc. real 7 = 0 do not perform the check.

 

The post error log:

 

15 Aug 2007 07:40:50 AM - <2> - Initialization of pre-defined post variables, strings, postblocks was successful.

15 Aug 2007 07:40:50 AM - <2> - Search for defined post variables, strings, postblocks was successful.

15 Aug 2007 07:40:50 AM - <2> - PST LINE (957) - Label has not been defined[26]

15 Aug 2007 07:40:50 AM - <2> - PST LINE (967) - Label has not been defined[5]

15 Aug 2007 07:40:50 AM - <2> - RUN TIME - PST(967), NCI(70) - The math calculation/formula has an error

15 Aug 2007 07:40:50 AM - <2> - RUN TIME - PST(967), NCI(144) - The math calculation/formula has an error

15 Aug 2007 07:40:50 AM - <2> - RUN TIME - PST(967), NCI(218) - The math calculation/formula has an error

15 Aug 2007 07:40:50 AM - <2> - Successful completion of posting process!

 

 

The post processor - lines 957 & 967 are in BOLD:

 

ptlbreak

pbld, pn, "TOOL CALL ", prv_t, *sgplane, *speed, peob, e$

pbld, pn, "TCH PROBE 586 TOOL BREAKAGE DETECTION ", e$

" Q356=+1", "; MEASURING DIRECTION", e$

" Q357=0", "; ROFFS OF MEASURING", e$

pbld, pn, "FN10: IF Q199 NE 2 GOTO LBL 1", e$

pbld, pn, "M00", "; TOOL BROKEN", e$

pbld, pn, "LBL 1", e$

 

 

ptlchg_com #Tool change common blocks

if mr7 = 1, ptlbreak, e$

if oldcool <> coolant$, pcooloff

cooloff = coolant$

pcom_moveb

c_mmlt$ #Multiple tool subprogram call

pn, ";", peob, e$

pwcs

ptoolcomm

pcan

pbld, pn, "TOOL CALL ", *t$, *sgplane, *speed, peob, e$

pn, ";", peob, e$

comment$

pn, ";", peob, e$

pstock

pindex

absinc$ = zero

if zretr > 0, pbld, pn, *sgcode, *zretr, *sccomp, pfmax, peob, e$

else, pbld, pn, *sgcode, "Z+21.0", *sccomp, pfmax, *sm92, peob, e$

pcan1, pbld, pn, *sgcode, pfxout, pfyout, pfcout,

pgear, strcantext, *sccomp, pfmax, *spindle, peob, e$

pbld, pn, *sgcode, pfzout, next_tool$, pfmax, scoolant, peob, e$

if oldcool <> coolant$, pcoolon

if coolant$ = 3, pbld, pn, "M28", ";", "THRU-SPINDLE ON", e$ #edit KAF

sav_z = zabs

absinc$ = sav_absinc

pcom_movea

toolchng = zero

c_msng$ #Single tool subprogram call

last_op_id = op_id$

if cycl32, pbld, pn, "CYCL DEF 32.0 TOLERANCE", e$

pbld, pn, "CYCL DEF 32.1 T", *mr1$, e$

pbld, pn, ";", popnote, e$

oldcool = coolant$

 

The NC output I'm currently getting is the tool break detection cycle is output at every tool change even if mic. real 7 is set to zero.

 

The machine is a Mikron 5-axis with Heidenhain TNC530 control.

 

Thanks

Link to comment
Share on other sites

first thing I see is

 

if mr7

 

should be

 

if mr7$

 

I would also add a sav_mr7 variable and use that to check against while setting the value at the beginning of the operation

 

sav_mi7 = mr7$

 

and then

 

if sav_mr7 = whatever

Link to comment
Share on other sites

OK, I'm getting there. I moved the "pltbreak" postblock call out of the tool change and into the postblock "ptoolend". This causes it to run at the end of the op which is much more appropriate. This means I can run the cycle on the current tool so there is no need to get the prev_t variable to work.

 

I still can't get the output to respond to the condition of mr7.....???

 

Am I doing something wrong?

 

sav_mr7 = mr7$

if sav_mr7 = 1, ptlbreak, e$

Link to comment
Share on other sites

Chris - thanks

 

John - I added the declaration statement but still does not behave.

 

From within the pre-defined postblock "ptoolend", I want to execute the postblock "ptlbreak" if mr7=1

 

this does not work:

 

sav_mr7 = mr7$

if sav_mr7 = 1, ptlbreak, e$

 

this also does not work:

 

if mr7$ = 1, ptlbreak, e$

 

this outputs the postblock every time (of course)

 

ptlbreak, e$

Link to comment
Share on other sites

try this

 

if sav_mr7 = 1, ptlbreak, e$

sav_mr7 = 0

 

 

Then it should run the first time through but it will not run again until it reads the beinging of an OP and rechecks the value of MR7$

Link to comment
Share on other sites

A little editing my previous Edit:

 

If you're turning on mr7$ on the first operation of that tool (that's what I do) move the "sav_mr7 = mr7$" to your toolchange postblock. If you're turning on during the tool's last op I THINK it would be ok there though I would put it in ptlchg0$ and the toolchange postblock.

 

ptoolend$ gets read with every depth of cut so you do need to tell it when to activate. (if nextop$ = 1002)

Link to comment
Share on other sites

Jim - not a silly question at all but I did check and mr7 is set to 1 in the .nci file.

 

Tim - I did have problems with output at each depth so I added a condition:

 

if t$<>abs(nexttool), ptlbreak, e$

 

I'll try (if nextop$ = 1002) if it gives me any more trouble.

 

John - I'll likely take you up on your offer if I don't resolve things soon.

 

I'll try out these suggestions to get the mr7 conditional output working. I appreciate everyone's help.

 

I just found out I can't use the laser to measure or perform breakage detection with 3D Rotation (Heidenhain Cycle 19) in effect. I think this means I'll need to read system variable to store the current B & C axis tilt values, then cancel 3D Rotation, then perform the breakage detection, then restore the 3D Rotation.........this is not going to be quick.....ideas are welcome.

Link to comment
Share on other sites

Can you try removing the , e$ after the If statement?

 

Also in your ptlbreak post block, make sure the "ptlbreak" title starts in the first column (no spaces before the p).

 

In your ptlbreak post block I also notice you have a

 

", peob, e$"

 

What are you doing with the "peob" post block? If you are trying to end the output line in the NC file, the "e$" is the end of line function. I think this could be the source of your problem.

 

Also, what is the "pn" post block for? If you are using the line numbering function it is now "n$" and it is a pre-defined function.

 

I'm guessing that your post is based on something pretty old that has been continously upgraded from Pre-X days. It would be highly worth it for you to download the FREE MPMaster X2 post and use it as a base for any new posts you need.

 

Also, try contacting your reseller and get a copy of the Mastercam V9 Post Processor Guide. This contains a wealth of information on the post, the user config file, and how to write/edit the logic routines to get the output you need. I've been dabbling in posts for years, but with the help of that guide, I've gotten pretty savvy lately.

 

HTH,

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