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:

Cutter comp on/off on arc - MPMaster


Guest
 Share

Recommended Posts

For anyone using the MPMaster....

 

There is a check built into the post for checking for cutter comp if it is on a arc move.....

 

I found today that a G40 can still be output on an arc move so I altered the based code to add an additional check

 

The original postblock.....

pcompwarn       #Cutter Compensation Check                     #added 10/02/15
      if prv_cc_pos$ <> cc_pos$ & cc_pos$ & gcode$ > 1,
        [
        if compwarnflg = 0, result = mprint(scompwarn) 
        spaces$ = 0
        n$, pspc, *sm00, " ", scomm_str, scompwarn, scomm_end, e$
        n$, pbld, exitpost$, e$
        spaces$ = sav_spc
        compwarnflg = 1
        ]

I added to it with this

pcompwarn       #Cutter Compensation Check                     #added 10/02/15
      if prv_cc_pos$ <> cc_pos$ & cc_pos$ & gcode$ > 1,
        [
        if compwarnflg = 0, result = mprint(scompwarn) 
        spaces$ = 0
        n$, pspc, *sm00, " ", scomm_str, scompwarn, scomm_end, e$
        n$, pbld, exitpost$, e$
        spaces$ = sav_spc
        compwarnflg = 1
        ]
       if prv_cc_pos$ <> cc_pos$ & cc_pos$ = 0 & gcode$ > 1,
         [
        if compwarnflg = 0, result = mprint(scompwarn) 
        spaces$ = 0
        n$, pspc, *sm00, " ", scomm_str, scompwarn, scomm_end, e$
        n$, pbld, exitpost$, e$
        spaces$ = sav_spc
        compwarnflg = 1
        ]
Link to comment
Share on other sites

John,

 

The 'exitpost$' function is a "Command Variable". It it typically invoked all by itself on a post line, because it immediately caused the post processor to exit the processing of the current NCI file. It basically forces everything to shut down "right now".

 

So any code that you would put after that command, in that post block, never gets ran.

 

Plus, you've got two blocks that basically do the same thing. The first block has " & cc_pos$ &"  <<< By using "cc_pos$" on the line as a Boolean condition, you are saying "any non-zero value".

 

Then in your next check, you are checking "cc_pos$ = 0". So that's basically, if you process through both blocks, then cc_pos$ could be any value, and it would trigger the block. You could probably just eliminate that 2nd condition.

 

I'd recommend doing this:


pcompwarn       #Cutter Compensation Check                     #added 10/02/15
      if prv_cc_pos$ <> cc_pos$ & cc_pos$ >= zero & gcode$ > one,
        [
        if compwarnflg = zero,
          [
          result = mprint(scompwarn) #Launch Comp Warning
          sav_spc = spaces$ #Save current value of Spaces from CD (could be on/off)
          spaces$ = zero #Force spaces "off"
          #Print warning to NC File
          n$, pspc, *sm00, pspc, scomm_str, scompwarn, scomm_end, e$
          spaces$ = sav_spc #Restore current spaces$ value
          compwarnflg = one
          # If the answer to "Yes/No" MB is "Yes", then exit posting process
          if mprint("DO YOU WANT TO EXIT THE POSTING PROCESS?", five) = 6, exitpost$
          ]

          # The 'mprint' function can take an optional "2nd" parameter
          # The possible second arguments are:
          # 1 = MB_OK The message box contains one pushbutton: OK.
          # 2 = MB_OKCANCEL Message box with: OK and Cancel buttons.
          # 3 = MB_ABORTRETRYIGNORE Three buttons: Abort, Retry, and Ignore.
          # 4 = MB_YESNOCANCEL Three buttons: Yes, No, and Cancel.
          # 5 = MB_YESNO Two buttons: Yes and No.
          # 6 = MB_RETRYCANCEL Two buttons: Retry and Cancel.
          # -------------------------------------------------------------
          # If this message box format is used, mprint returns a number:
          # 1 = IDOK The OK button was selected.
          # 2 = IDCANCEL The Cancel button was selected.
          # 3 = IDABORT The Abort button was selected.
          # 4 = IDRETRY The Retry button was selected.
          # 5 = IDIGNORE The Ignore button was selected.
          # 6 = IDYES The Yes button was selected.
          # 7 = IDNO The No button was selected.

Ignore the comments below the post block end, they are just for anyone else that might be reading.

 

By using the "if mprint(x, n) = _, " line, it lets you test the result of the 'mprint' statement.

 

In the block, I'm using 'mprint' twice. The first time, we just warn the user with the normal 'mprint' (no 2nd parameter). I'd do that if your 'scomp' warning doesn't inform the user "do you want to exit the post?". So the 2nd time we launch it, we test the response from the user. We can launch 6 different types of Message Boxes, and the user's response indicates which button was pressed. Each different type of box can have different numeric responses. For a Yes/No MB (type 5), the answers would be 6 for "yes", and 7 for "no". For "type 1", which is an "ok" only MB, the answer can only ever be "1". (so testing for anything, with "type 1 MB" would be pointless.)

Link to comment
Share on other sites

John,

 

The 'exitpost$' function is a "Command Variable". It it typically invoked all by itself on a post line, because it immediately caused the post processor to exit the processing of the current NCI file. It basically forces everything to shut down "right now".

 

So any code that you would put after that command, in that post block, never gets ran.

 

Plus, you've got two blocks that basically do the same thing. The first block has " & cc_pos$ &"  <<< By using "cc_pos$" on the line as a Boolean condition, you are saying "any non-zero value".

 

Then in your next check, you are checking "cc_pos$ = 0". So that's basically, if you process through both blocks, then cc_pos$ could be any value, and it would trigger the block. You could probably just eliminate that 2nd condition.

 

I'd recommend doing this:


pcompwarn       #Cutter Compensation Check                     #added 10/02/15
      if prv_cc_pos$ <> cc_pos$ & cc_pos$ >= zero & gcode$ > one,
        [
        if compwarnflg = zero,
          [
          result = mprint(scompwarn) #Launch Comp Warning
          sav_spc = spaces$ #Save current value of Spaces from CD (could be on/off)
          spaces$ = zero #Force spaces "off"
          #Print warning to NC File
          n$, pspc, *sm00, pspc, scomm_str, scompwarn, scomm_end, e$
          spaces$ = sav_spc #Restore current spaces$ value
          compwarnflg = one
          # If the answer to "Yes/No" MB is "Yes", then exit posting process
          if mprint("DO YOU WANT TO EXIT THE POSTING PROCESS?", five) = 6, exitpost$
          ]

          # The 'mprint' function can take an optional "2nd" parameter
          # The possible second arguments are:
          # 1 = MB_OK The message box contains one pushbutton: OK.
          # 2 = MB_OKCANCEL Message box with: OK and Cancel buttons.
          # 3 = MB_ABORTRETRYIGNORE Three buttons: Abort, Retry, and Ignore.
          # 4 = MB_YESNOCANCEL Three buttons: Yes, No, and Cancel.
          # 5 = MB_YESNO Two buttons: Yes and No.
          # 6 = MB_RETRYCANCEL Two buttons: Retry and Cancel.
          # -------------------------------------------------------------
          # If this message box format is used, mprint returns a number:
          # 1 = IDOK The OK button was selected.
          # 2 = IDCANCEL The Cancel button was selected.
          # 3 = IDABORT The Abort button was selected.
          # 4 = IDRETRY The Retry button was selected.
          # 5 = IDIGNORE The Ignore button was selected.
          # 6 = IDYES The Yes button was selected.
          # 7 = IDNO The No button was selected.

Ignore the comments below the post block end, they are just for anyone else that might be reading.

 

By using the "if mprint(x, n) = _, " line, it lets you test the result of the 'mprint' statement.

 

In the block, I'm using 'mprint' twice. The first time, we just warn the user with the normal 'mprint' (no 2nd parameter). I'd do that if your 'scomp' warning doesn't inform the user "do you want to exit the post?". So the 2nd time we launch it, we test the response from the user. We can launch 6 different types of Message Boxes, and the user's response indicates which button was pressed. Each different type of box can have different numeric responses. For a Yes/No MB (type 5), the answers would be 6 for "yes", and 7 for "no". For "type 1", which is an "ok" only MB, the answer can only ever be "1". (so testing for anything, with "type 1 MB" would be pointless.)

 

Colin,

 

The first block is as originally put into the MPMaster...it does catch the G41/G42 on an arc......it does not however catch a G40 being output on an arc.....the additional check has shown in testing that is does catch the condition of G40 on an arc move.....

 

As far as the exitpost, I use it in that way, I get an error message to my screen telling me what failed and the M00 bombs it at the point so  can just back scroll and see which path it happened on...fix it and post again.....

Link to comment
Share on other sites

So, I posted a bit of code that I know puts out a comp off on an arc on the base logic in the MPMaster.....

 

comp_02_zps30xayr94.jpg

 

and I get this....

 

comp_03_zpshiurekap.jpg

 

so the base check does not catch the G40.....

 

I added what I added check for comp having been on previously and now being off.....

 

comp_04_zpsacser2yd.jpg

 

and I get this on the screen

 

comp_05_zps806jffci.jpg

 

and it exits right at the error point

 

comp_06_zpsm8wuj6yc.jpg

 

When dealing with hundreds of operations it makes it quick to track down the operation that has the issue.

 

Mind you, the original logic is not mine except for the exitpost, I copied what was original and modified the check line.....

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