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:

plinout question


Recommended Posts

Hi,

 

I'd like to convert this rotary move

 

G0 G90 G54 X-2.585 Y0. S6000 M3
G43 H8 Z15.445
M8
Z12.545
G1 Z12.07 F100.
G42 D8 X-2.485 F54.
A55.68 F256.34 < - - - -  -
G40 X-2.585 F54.
G0 Z12.32

 

into this:

 

G0 G90 G54 X-2.585 Y0. S6000 M3
G43 H8 Z15.445
M8
Z12.545
G1 Z12.07 F100.
G42 D8 X-2.485 F54.
\ M80 (A55.68 F256.34) < - - - - -
G40 X-2.585 F54.
G0 Z12.32

 

I think this is the spot (using Generic Fanuc 4X Mill.pst, M17.0)

 

plinout         #Output to NC of linear movement - feed              
      pcan1, pbld, n$, sgfeed, sgplane, `sgcode, sgabsinc, pccdia,
      pxout, pyout, pzout, pcout, feed, strcantext, pscool, e$

 

I think I need to know when "pcout" is about to be "executed" to apply my logic and the M code.  What and how do I need to "capture"? Like if pcout = "valid".  Could someone give some guidance?

 

Thank you.

Link to comment
Share on other sites

Try this

pindex          #Index output
      if index & rot_on_x,
        [
        if (prv_indx_out <> fmtrnd(indx_out)) | (prv_cabs <> fmtrnd(cabs)),
          [
          if use_rot_lock, prot_unlock
          pfbld, n$, [if use_rotmcode, `sindx_mc], "M80", "(", *indx_out, *feed, ")", e$
          !cabs, !cinc
          ]
        if use_rot_lock, prot_lock
        ]
Link to comment
Share on other sites

JParis,

 

I tried the code and ran it with the debugger:

 

pindex:  The debugger did stop at the breakpoint set here but it seemed that the result wouldn't come from here.  Spelling checked, even pfbld changed to pbld.  Even the whole line commented out. : ) but the angle still got posted out.

 

plinout:  It seemed the angle got posted out from here thru "pcout" when it was its turn.  If M80 inserted here it would come out but so was x or z move, with M80.

 

In the nci lines below, the angle gets posted out from the red line with number 1100 at the end.  Can that number get captured somehow and analyzed in a logic?

 

 

 

142 -2.485 6.44659664 -0.375 54. 200010 -2.485 -6.44659664 -0.375 -1. 11001140 -2.585 -6.44659664 -0.375 -1. 200

for

G42 D8 X-2.485 F54.
A55.68 F256.34 < - - - -  -
G40 X-2.585 F54.

 

Your thought? (before I fry my brain) And thanks for your help.

Link to comment
Share on other sites

My best guess would be to change the Pcout post block from

 

pcout           #C axis output
      if index = zero & rot_on_x,
        [
        if use_rotmcode & cabs <> prv_cabs, *sindx_mc
        if absinc$ = zero, cabs, !cinc
        else, cinc, !cabs
        ]

 

to

 

 

pcout           #C axis output
      if index = zero & rot_on_x,
        [
        if use_rotmcode & cabs <> prv_cabs, *sindx_mc
        if absinc$ = zero, "\ M80", "(", cabs, !cinc, "0"
        else, "\ M80", "(", cinc, !cabs, ")"
        ]

Link to comment
Share on other sites

Hi Ben,

 

I tried that way too.  However, all the routines that has "pcout" when "called" will also output "\ M80".  In other word, from the G1 Z feed down up to the rapid Z up move will have "\ M80" in the line.  I found a temporary fix that would do just that but wasn't happy with it.  I don't remember what that routine was but it's supposed to be used with switches.  I replaced pcout with that routine and it did what I wanted.  I've been extremely busy with other tasks and will revisit this again.  Thanks all for the help.

Link to comment
Share on other sites

If I am understanding correctly you want it to output when the pcout is called from within the plinout post block but not at any other time.  If that is what you are trying to do I would created a new post block called something like pcout2 and change the pcout to pcout2 in the plinout post block.   Have the new pcout2 post block look like the following.

 

pcout2           #C axis output
      if index = zero & rot_on_x,
        [
        if use_rotmcode & cabs <> prv_cabs, *sindx_mc
        if absinc$ = zero, "\ M80", "(", cabs, !cinc, "0"
        else, "\ M80", "(", cinc, !cabs, ")"
        ]

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