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:

G17, G18, G19


Recommended Posts

Hello everyone,
   I have an old old machine of which it must have G17/G18/G19 in order to run.  My post, of which I downloaded from eMasterCam.Com somehow it does not force the SGPLANE.  Would you guys please educate me how to make it forces GPLANE all the time?  Thank you.

 

# Select work plane G code
sg17    : "G17"      #XY plane code 
sg18    : "G18"      #XZ plane code
sg19    : "G19"      #YZ plane code 
sgplane : ""         #Target string

fstrsel sg17 plane$ sgplane 3 -1
#Region Motion NC output
# --------------------------------------------------------------------------
# Motion NC output
# --------------------------------------------------------------------------
#The variables for absolute output are xabs, yabs, zabs.
#The variables for incremental output are xinc, yinc, zinc.
# --------------------------------------------------------------------------
prapidout       #Output to NC of linear movement - rapid 
      sav_gcode = gcode$
      if convert_rpd$ = one,
        [
        gcode$ = one
        feed = maxfeedpm
        ipr_type = zero
        ]

    #"DEBUG: ", ~mr3$, ~nextop$, e$
      if tool_op$ = 19, "M0(AGAINST PIN STOP HERE)", e$
      pcan1, pbld, n$, [if prv_sgplane <> sgplane, sgplane], `sgcode, [if prv_sgplane <> sgplane, sgabsinc], pccdia, [if gcode$ = 1, sgfeed]
        pxout, pyout, pzout, [if HorizontalCellSystem <> 2, pcout], [if gcode$ = 1, `feed], strcantext, scoolant, e$
      gcode$ = sav_gcode
	  
plinout         #Output to NC of linear movement - feed  
      pcan1, pbld, [if prv_sgplane <> sgplane, sgplane], `sgcode, [if prv_sgplane <> sgplane, sgabsinc], pccdia, #, n$, sgfeed
        pxout, pyout, pzout, [if HorizontalCellSystem <> 2, pcout], `feed, strcantext, scoolant, e$

pcirout         #Output to NC of circular interpolation
      if not(arccomp), pcompwarn, pCircleMillCutterCompAlarm, pHelixBoreCompWarn
      if full_arc_flg$,
        [
        if plane$ = zero, result = force(xabs,yabs)   #force coordinate on full arc              
        if plane$ = one,  result = force(yabs,zabs)   #force coordinate on full arc              
        if plane$ = two,
          [
          result = force(xabs,xabs)   #force coordinate on full arc              
          result = force(zabs,zabs)   #force coordinate on full arc              
          ]
        ]
      if hel_2100 = one, pcirout2
      else, pcirout1

pcirout1        #Output to NC of circular interpolation
      pcan1, pbld, [if prv_sgplane <> sgplane, sgplane], sgcode, [if prv_sgplane <> sgplane, sgabsinc], pccdia, #, n$, `sgfeed
        pxout, pyout, pzout, [if HorizontalCellSystem <> 2, pcout], parc, feed, strcantext, scoolant, e$

pcirout2        #Output to NC of circular interpolation
      if (plane$ = zero & fmtrnd(zinc)<>0)
       | (plane$ =  one & fmtrnd(xinc)<>0)
       | (plane$ =  two & fmtrnd(yinc)<>0), phelout
      else, pcirout1

phelout         #Output to NC of helical interpolation
      if errorcheck = one, [if not(arccomp), pcompwarn, pCircleMillCutterCompAlarm, pHelixBoreCompWarn]
      if plane$ = zero,
        [
        result = nwadrs(strk, lead)
        lead = abs(zinc/sweep$*360)
        ]
      if plane$ = one,
        [
        result = nwadrs(stri, lead)
        lead = abs(xinc/sweep$*360)
        ]
      if plane$ = two,
        [
        result = nwadrs(strj, lead)
        lead = abs(yinc/sweep$*360)
        ]
      pcan1, pbld, [if prv_sgplane <> sgplane, sgplane], sgcode, [if prv_sgplane <> sgplane, sgabsinc], pccdia, #, n$, `sgfeed
        pxout, pyout, pzout, *lead, [if HorizontalCellSystem <> 2, pcout], parc, feed, strcantext, scoolant, e$
#EndRegion prapidout
Link to comment
Share on other sites

I think if you took this and changed it to this you would get it every time it changed if you need it every time it changes.

[if prv_sgplane <> sgplane, sgplane]

to this:

[if prv_sgplane <> sgplane, *sgplane]

If you want it all that replace the above with this:

pbfplane
  

Then make a section like this in your post to force output:

pbfplane
      *sgplane

 

Link to comment
Share on other sites
44 minutes ago, C^Millman said:

I think if you took this and changed it to this you would get it every time it changed if you need it every time it changes.


[if prv_sgplane <> sgplane, sgplane]

to this:


[if prv_sgplane <> sgplane, *sgplane]

If you want it all that replace the above with this:


pbfplane
  

Then make a section like this in your post to force output:


pbfplane
      *sgplane

 

Hello Millman,
   I tried as you directed and it didn't work.  

 

 

 

Thanks.

Link to comment
Share on other sites
58 minutes ago, C^Millman said:

Okay you want a forced output and I think you are in the right area. Jeff or Colin will have to chime in.

 

I just tried this and it spits out G19 instead of G18 and I know G18 is the right one but don't know why it spits out G19, Thank you.

 

prapidout       #Output to NC of linear movement - rapid 
      sav_gcode = gcode$
      if convert_rpd$ = one,
        [
        gcode$ = one
        feed = maxfeedpm
        ipr_type = zero
        ]

    #"DEBUG: ", ~mr3$, ~nextop$, e$
      if tool_op$ = 19, "M0(AGAINST PIN STOP HERE)", e$
      pcan1, pbld, n$, sgplane, `sgcode, [if prv_sgplane <> sgplane, sgabsinc], pccdia, [if gcode$ = 1, sgfeed]
        pxout, pyout, pzout, [if HorizontalCellSystem <> 2, pcout], [if gcode$ = 1, `feed], strcantext, scoolant, e$
      gcode$ = sav_gcode
	  
plinout         #Output to NC of linear movement - feed
      pcan1, pbld, sgplane, `sgcode, [if prv_sgplane <> sgplane, sgabsinc], pccdia, #, n$, sgfeed
        pxout, pyout, pzout, [if HorizontalCellSystem <> 2, pcout], `feed, strcantext, scoolant, e$

pcirout         #Output to NC of circular interpolation
      if not(arccomp), pcompwarn, pCircleMillCutterCompAlarm, pHelixBoreCompWarn
      if full_arc_flg$,
        [
        if plane$ = zero, result = force(xabs,yabs)   #force coordinate on full arc              
        if plane$ = one,  result = force(yabs,zabs)   #force coordinate on full arc              
        if plane$ = two,
          [
          result = force(xabs,xabs)   #force coordinate on full arc              
          result = force(zabs,zabs)   #force coordinate on full arc              
          ]
        ]
      if hel_2100 = one, pcirout2
      else, pcirout1

pcirout1        #Output to NC of circular interpolation
      pcan1, pbld, sgplane, sgcode, [if prv_sgplane <> sgplane, sgabsinc], pccdia, #, n$, `sgfeed
        pxout, pyout, pzout, [if HorizontalCellSystem <> 2, pcout], parc, feed, strcantext, scoolant, e$

pcirout2        #Output to NC of circular interpolation
      if (plane$ = zero & fmtrnd(zinc)<>0)
       | (plane$ =  one & fmtrnd(xinc)<>0)
       | (plane$ =  two & fmtrnd(yinc)<>0), phelout
      else, pcirout1

phelout         #Output to NC of helical interpolation
      if errorcheck = one, [if not(arccomp), pcompwarn, pCircleMillCutterCompAlarm, pHelixBoreCompWarn]
      if plane$ = zero,
        [
        result = nwadrs(strk, lead)
        lead = abs(zinc/sweep$*360)
        ]
      if plane$ = one,
        [
        result = nwadrs(stri, lead)
        lead = abs(xinc/sweep$*360)
        ]
      if plane$ = two,
        [
        result = nwadrs(strj, lead)
        lead = abs(yinc/sweep$*360)
        ]
      pcan1, pbld, sgplane, sgcode, [if prv_sgplane <> sgplane, sgabsinc], pccdia, #, n$, `sgfeed
        pxout, pyout, pzout, *lead, [if HorizontalCellSystem <> 2, pcout], parc, feed, strcantext, scoolant, e$
Link to comment
Share on other sites
15 hours ago, PcRobotic said:

 

I just tried this and it spits out G19 instead of G18 and I know G18 is the right one but don't know why it spits out G19, Thank you.

 

Steven,

All linear motion is the same, no matter which plane you are working in.

This motion:

G1 X0. Y0. Z0.

X-2. Y3.12

Z5.

X5. Y6. Z10.

Is the same, regardless of the plane you are working in.

The only "motion" that requires a plane designation to work properly is an Arc.

The "arc plane" is output by Mastercam, in the form of NCI data. This is the only "trigger" that should be used to switch planes.

Linear motion (G01) or Rapid motion (G00) is exactly the same, no matter which plane you are in.

Post up the NCI Data that you think should be giving you "G18". Unless you have a "G18 Arc" in the NCI File, all your motion for a Milling Machine should be in G17.

Now, if the NCI Data contains a "G18 or G19" Arc in the NCI code, the post will automatically read that, and spit out G18 or G19, as needed. The Post will "remain" in the last plane you were in, until a "new arc" comes along. If that arc is defined in a different plane, from the "last plane" you used, then Mastercam's Plane Selection mechanism, which uses a String Select Function, will simply output the code that is defined inside the NCI data.

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

Now, there is a .000001% possibility that "you really do need a G18", where you think you need it. However, the more likely scenario is that you don't really understand the use of the G17, G18, and G19 planes, and you are just asking for something because "you think" you need it, or someone "told you" that you need it.

But consider that millions of people have used Mastercam since it was founded in 1983. There are literally hundreds of thousands of Post Processors out there, that do milling, and I would wager that over 100,000 of those Posts use the MPMaster Post as a "base post". Again, there is about a .000001% possibility that you have some kind of unique machine, but my guess is that you have convinced yourself that you "need something", that really isn't needed.

Post up the NCI data and let us take a look.

The only time you should get G18 or G19 is if you have Arc Motion, that is on the ZX or YZ Plane.

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

What kind of machine is this for? Is it 3 Axis, or 4 Axis, and is it Vertical or Horizontal?

The only kind of machine that would need to "default" to G18 is a Lathe. (G18 is Z X plane. Note, that it is listed Z X. Not, X Z. This is important, due to the G02/G03 CW vs. CCW direction)

 

  • Like 2
Link to comment
Share on other sites
1 hour ago, Colin Gilchrist said:

Steven,

All linear motion is the same, no matter which plane you are working in.

This motion:

G1 X0. Y0. Z0.

X-2. Y3.12

Z5.

X5. Y6. Z10.

Is the same, regardless of the plane you are working in.

The only "motion" that requires a plane designation to work properly is an Arc.

The "arc plane" is output by Mastercam, in the form of NCI data. This is the only "trigger" that should be used to switch planes.

Linear motion (G01) or Rapid motion (G00) is exactly the same, no matter which plane you are in.

Post up the NCI Data that you think should be giving you "G18". Unless you have a "G18 Arc" in the NCI File, all your motion for a Milling Machine should be in G17.

Now, if the NCI Data contains a "G18 or G19" Arc in the NCI code, the post will automatically read that, and spit out G18 or G19, as needed. The Post will "remain" in the last plane you were in, until a "new arc" comes along. If that arc is defined in a different plane, from the "last plane" you used, then Mastercam's Plane Selection mechanism, which uses a String Select Function, will simply output the code that is defined inside the NCI data.

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

Now, there is a .000001% possibility that "you really do need a G18", where you think you need it. However, the more likely scenario is that you don't really understand the use of the G17, G18, and G19 planes, and you are just asking for something because "you think" you need it, or someone "told you" that you need it.

But consider that millions of people have used Mastercam since it was founded in 1983. There are literally hundreds of thousands of Post Processors out there, that do milling, and I would wager that over 100,000 of those Posts use the MPMaster Post as a "base post". Again, there is about a .000001% possibility that you have some kind of unique machine, but my guess is that you have convinced yourself that you "need something", that really isn't needed.

Post up the NCI data and let us take a look.

The only time you should get G18 or G19 is if you have Arc Motion, that is on the ZX or YZ Plane.

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

What kind of machine is this for? Is it 3 Axis, or 4 Axis, and is it Vertical or Horizontal?

The only kind of machine that would need to "default" to G18 is a Lathe. (G18 is Z X plane. Note, that it is listed Z X. Not, X Z. This is important, due to the G02/G03 CW vs. CCW direction)

 

Hi Colin,
   Thank you for your responding with much valuable information.  In this case, I really need it spits out G18 because I have tried and I almost scrapped a $50K part because the 1.000 radius became a CHAMFER.  I didn't know what's wrong the program when the simulation is right, everything looks good in MasterCam.  I called CNC Software and they inspected they asked me a few questions and they told me that I "MUST HAVE" G18 and I told them "THAT IS INSANE"... Guess what?  I used G18 and it worked.

   Automatically, I thought of asking eMasterCam Forum how to make the G18/ G19 spits out right.  Once again, I have an old beast as NIIGATA, about 30 years old....  Most of the codes aren't built in the macro and I have to make the G-CODEs works around with it.

 

PS: MasterCam's stock post it spits out G18 but the EMASTERCAM post spits out G19, which one should I trust?  I tested G18 it works but not sure the EMASTERCAM as it has G19 although same below codes.

 

Thank you Colin,
   S.Luong

 

 

 

Link to comment
Share on other sites
55 minutes ago, PcRobotic said:

Hi Colin,
   Thank you for your responding with much valuable information.  In this case, I really need it spits out G18 because I have tried and I almost scrapped a $50K part because the 1.000 radius became a CHAMFER.  I didn't know what's wrong the program when the simulation is right, everything looks good in MasterCam.  I called CNC Software and they inspected they asked me a few questions and they told me that I "MUST HAVE" G18 and I told them "THAT IS INSANE"... Guess what?  I used G18 and it worked.

   Automatically, I thought of asking eMasterCam Forum how to make the G18/ G19 spits out right.  Once again, I have an old beast as NIIGATA, about 30 years old....  Most of the codes aren't built in the macro and I have to make the G-CODEs works around with it.

 

PS: MasterCam's stock post it spits out G18 but the EMASTERCAM post spits out G19, which one should I trust?  I tested G18 it works but not sure the EMASTERCAM as it has G19 although same below codes.

 

Thank you Colin,
   S.Luong

 

 

 

CAV(Computer Aided Verification)

Let me Repeat myself.

CAV.

One more time CAV!!!!!!!

You about scrapped a part that would have more than paid for a CAV. Time to get a CAV and not risk this again!!!!!

Link to comment
Share on other sites
15 hours ago, C^Millman said:

CAV(Computer Aided Verification)

Let me Repeat myself.

CAV.

One more time CAV!!!!!!!

You about scrapped a part that would have more than paid for a CAV. Time to get a CAV and not risk this again!!!!!

Butttttttt....... Ron, he posted the other day that he couldn't even get a faster PC so...

  • Like 2
Link to comment
Share on other sites
21 hours ago, Colin Gilchrist said:

Steven,

All linear motion is the same, no matter which plane you are working in.

This motion:

G1 X0. Y0. Z0.

X-2. Y3.12

Z5.

X5. Y6. Z10.

Is the same, regardless of the plane you are working in.

The only "motion" that requires a plane designation to work properly is an Arc.

The "arc plane" is output by Mastercam, in the form of NCI data. This is the only "trigger" that should be used to switch planes.

Linear motion (G01) or Rapid motion (G00) is exactly the same, no matter which plane you are in.

Post up the NCI Data that you think should be giving you "G18". Unless you have a "G18 Arc" in the NCI File, all your motion for a Milling Machine should be in G17.

Now, if the NCI Data contains a "G18 or G19" Arc in the NCI code, the post will automatically read that, and spit out G18 or G19, as needed. The Post will "remain" in the last plane you were in, until a "new arc" comes along. If that arc is defined in a different plane, from the "last plane" you used, then Mastercam's Plane Selection mechanism, which uses a String Select Function, will simply output the code that is defined inside the NCI data.

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

Now, there is a .000001% possibility that "you really do need a G18", where you think you need it. However, the more likely scenario is that you don't really understand the use of the G17, G18, and G19 planes, and you are just asking for something because "you think" you need it, or someone "told you" that you need it.

But consider that millions of people have used Mastercam since it was founded in 1983. There are literally hundreds of thousands of Post Processors out there, that do milling, and I would wager that over 100,000 of those Posts use the MPMaster Post as a "base post". Again, there is about a .000001% possibility that you have some kind of unique machine, but my guess is that you have convinced yourself that you "need something", that really isn't needed.

Post up the NCI data and let us take a look.

The only time you should get G18 or G19 is if you have Arc Motion, that is on the ZX or YZ Plane.

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

What kind of machine is this for? Is it 3 Axis, or 4 Axis, and is it Vertical or Horizontal?

The only kind of machine that would need to "default" to G18 is a Lathe. (G18 is Z X plane. Note, that it is listed Z X. Not, X Z. This is important, due to the G02/G03 CW vs. CCW direction)

 

Hi Colin,
   I have compared two different posts and they have defined 2 different ways of "PARC".  I am apologize for asking to many "dumb questions" and I would like to know since I don't know for better understanding.  

   As I can see that they can defined 2 different ways of PARC, which one is best? 

 

++++++++++++++++++++
Mastercam's default post....

parc            #Select the arc output
      if arcoutput$ = zero | full_arc_flg$ | arc_pitch$,
        [
        #Arc output for IJK
        # If you do NOT want to force out the I,J,K values,
        # remove the "*" asterisks on the *i, *j, *k 's below...
        if plane$ = zero, *i$, *j$, k$  #XY plane code - G17
        if plane$ = one, i$, *j$, *k$   #YZ plane code - G19
        if plane$ = two, *i$, j$, *k$   #XZ plane code - G18
        ]
      else,
        [
        #Arc output for R
        if abs(sweep$)<=180 | arcoutput$=one, result = nwadrs(srad, arcrad$)
        else, result = nwadrs(srminus, arcrad$)
        *arcrad$
        ]

 

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

emastercam's post....

#Region parc
parc            #Select the arc output
      if (plane$ = zero & (arctype$ = one | arctype$ = four)) |   #XY Plane
        (plane$ = one & (arctypeyz$ = one | arctypeyz$ = four)) | #YZ Plane
        (plane$ = two & (arctypexz$ = one | arctypexz$ = four)),  #XZ Plane
        [
        result = newfs(two, iout)
        result = newfs(two, jout)
        result = newfs(two, kout)
        ]
      else,
        [
        result = newfs(three, iout)
        result = newfs(three, jout)
        result = newfs(three, kout)
        ]
      if (plane$ = 0 & arctype$ < five) | (plane$ = 1 & arctypeyz$ < five) |
        (plane$ = 2 & arctypexz$ < five) | full_arc_flg$,
        [
        #Arc output for IJK
        # If you do NOT want to force out the I,J,K values,
        # remove the "*" asterisks on the *i, *j, *k 's below...
        if plane$ = zero, iout, jout, kout #XY plane code - G17
        if plane$ = one, iout, jout, kout  #YZ plane code - G19
        if plane$ = two, iout, jout, kout  #XZ plane code - G18
        !i$, !j$, !k$
        ]
      else,
        [
        #Arc output for R
        if abs(sweep$)<=180 | arcoutput$=one, result = nwadrs(srad, arcrad$)
        else, result = nwadrs(srminus, arcrad$)
        *arcrad$
        ]
#EndRegion parc
Link to comment
Share on other sites

The questions you ask are not dumb at all Steven, and I'm sorry if you got that impression from my previous posts. Sometimes I get frustrated with you, because of the way that you approach certain issues. It seems like sometimes you fight so hard to try and "bend the software to your will", rather than trying to understand the underlying software architecture.

 

I do think this is a good example you have chosen. The reason I think it is a good example, is that while the logic is written slightly differently, the end result from both Post Block output lines is exactly the same.

Here is a question for you: do you believe that 'parc' has anything to do with "G17, G19, or G18'?

 

 

The answer is 'parc' has absolutely nothing to do with Plane selection.

The 'parc' Post Block is used to output "Arc Center Point Output".

Both of those Post Blocks only do 1 of 2 things:

1. The Post Block will output IJ, IK, or JK, arc center coordinates.

2. Or, the Post Block will output Radius (R) values to define the Arc.

 

I really don't think one of these is "better" than the other. I think they are each setup to operate in a different scripting environment, and use different coding styles.

For example, the MPMaster version of the block includes "format changes" for Absolute vs. Incremental output. (newfs statements)

There is similar code in the Generic Fanuc 4X Mill Post, but that formatting code is located in a different place. Additionally, there is code in the MPMaster version to "update i$, j$, and k$" inside the 'parc' block. The Gen Fan 4X Mill Post has similar code, just in a different place. 

Really, it is so important to understand that these Post Block examples perform the exact same functions. They output IJK or R values to the line of NC Code output, within the 'pcirout' Post Block structure. 

  • Thanks 1
Link to comment
Share on other sites
On 5/18/2018 at 11:26 AM, Colin Gilchrist said:

Steven,

All linear motion is the same, no matter which plane you are working in.

This motion:

G1 X0. Y0. Z0.

X-2. Y3.12

Z5.

X5. Y6. Z10.

Is the same, regardless of the plane you are working in.

The only "motion" that requires a plane designation to work properly is an Arc.

The "arc plane" is output by Mastercam, in the form of NCI data. This is the only "trigger" that should be used to switch planes.

Linear motion (G01) or Rapid motion (G00) is exactly the same, no matter which plane you are in.

Post up the NCI Data that you think should be giving you "G18". Unless you have a "G18 Arc" in the NCI File, all your motion for a Milling Machine should be in G17.

Now, if the NCI Data contains a "G18 or G19" Arc in the NCI code, the post will automatically read that, and spit out G18 or G19, as needed. The Post will "remain" in the last plane you were in, until a "new arc" comes along. If that arc is defined in a different plane, from the "last plane" you used, then Mastercam's Plane Selection mechanism, which uses a String Select Function, will simply output the code that is defined inside the NCI data.

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

Now, there is a .000001% possibility that "you really do need a G18", where you think you need it. However, the more likely scenario is that you don't really understand the use of the G17, G18, and G19 planes, and you are just asking for something because "you think" you need it, or someone "told you" that you need it.

But consider that millions of people have used Mastercam since it was founded in 1983. There are literally hundreds of thousands of Post Processors out there, that do milling, and I would wager that over 100,000 of those Posts use the MPMaster Post as a "base post". Again, there is about a .000001% possibility that you have some kind of unique machine, but my guess is that you have convinced yourself that you "need something", that really isn't needed.

Post up the NCI data and let us take a look.

The only time you should get G18 or G19 is if you have Arc Motion, that is on the ZX or YZ Plane.

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

What kind of machine is this for? Is it 3 Axis, or 4 Axis, and is it Vertical or Horizontal?

The only kind of machine that would need to "default" to G18 is a Lathe. (G18 is Z X plane. Note, that it is listed Z X. Not, X Z. This is important, due to the G02/G03 CW vs. CCW direction)

 

Hi Colin,
   Thank you for your kindly responding to my question.  I've been trying to find out why my post of which I download from this forum is only spits out  G19 but not G18.  MasterCam's post is spitting out G18.  That's why I am looking deeply into the PARC, GPLANE. 

 

This is the part that I am doing and don't know why it won't spit G18 like other stock's posts.  I also attached the screenshot with notes, picture worths thousand words.

 

Thank you Colin.

 

 

Capture.PNG

Link to comment
Share on other sites
1 hour ago, Orvie said:

Are there other differences in your code besides G18 & G19?

If the post is rotating your coordinates (G68), you wouldn't need the G19.

Hi Olive,
   My machine is pretty old, I guess we have to pay good people to write macro G65.  That is why I am in deep trouble with G17, G18, G19.

Link to comment
Share on other sites
On 5/19/2018 at 7:32 PM, Colin Gilchrist said:

The questions you ask are not dumb at all Steven, and I'm sorry if you got that impression from my previous posts. Sometimes I get frustrated with you, because of the way that you approach certain issues. It seems like sometimes you fight so hard to try and "bend the software to your will", rather than trying to understand the underlying software architecture.

 

I do think this is a good example you have chosen. The reason I think it is a good example, is that while the logic is written slightly differently, the end result from both Post Block output lines is exactly the same.

Here is a question for you: do you believe that 'parc' has anything to do with "G17, G19, or G18'?

 

 

The answer is 'parc' has absolutely nothing to do with Plane selection.

The 'parc' Post Block is used to output "Arc Center Point Output".

Both of those Post Blocks only do 1 of 2 things:

1. The Post Block will output IJ, IK, or JK, arc center coordinates.

2. Or, the Post Block will output Radius (R) values to define the Arc.

 

I really don't think one of these is "better" than the other. I think they are each setup to operate in a different scripting environment, and use different coding styles.

For example, the MPMaster version of the block includes "format changes" for Absolute vs. Incremental output. (newfs statements)

There is similar code in the Generic Fanuc 4X Mill Post, but that formatting code is located in a different place. Additionally, there is code in the MPMaster version to "update i$, j$, and k$" inside the 'parc' block. The Gen Fan 4X Mill Post has similar code, just in a different place. 

Really, it is so important to understand that these Post Block examples perform the exact same functions. They output IJK or R values to the line of NC Code output, within the 'pcirout' Post Block structure. 

Hi Colin,
   I tested the post from EMASTERCAM forum and it worked.  At the beginning it spits out G19 but I made it changed to G18 and it worked fine.  Here how I did it.

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

ptlchg_com      #Tool change common blocks
      if plane$ <> 0, plane$ = 0
      pbld, no_spc$, sg00, *sgplane, sg40, sg49, sg80, sg90, [if mr1$ = 5, "H0 Z0 E0"], e$ # First safety line here


prapidout       #Output to NC of linear movement - rapid 
      sav_gcode = gcode$
      if convert_rpd$ = one,
        [
        gcode$ = one
        feed = maxfeedpm
        ipr_type = zero
        ]

      if tool_op$ = 19, "M0(AGAINST PIN STOP HERE)", e$
      pcan1, pbld, n$, [if plane$ > 0, plane$ = 1, sgplane], `sgcode, [if prv_sgplane <> sgplane, sgabsinc], pccdia, [if gcode$ = 1, sgfeed]
        pxout, pyout, pzout, [if HorizontalCellSystem <> 2, pcout], [if gcode$ = 1, `feed], strcantext, scoolant, e$
      gcode$ = sav_gcode
	  
plinout         #Output to NC of linear movement - feed  
      pcan1, pbld, [if plane$ > 0, plane$ = 1, sgplane], `sgcode, [if prv_sgplane <> sgplane, sgabsinc], pccdia, #, n$, sgfeed
        pxout, pyout, pzout, [if HorizontalCellSystem <> 2, pcout], `feed, strcantext, scoolant, e$

pcirout         #Output to NC of circular interpolation
      if not(arccomp), pcompwarn, pCircleMillCutterCompAlarm, pHelixBoreCompWarn
      if full_arc_flg$,
        [
        if plane$ = zero, result = force(xabs,yabs)   #force coordinate on full arc              
        if plane$ = one,  result = force(yabs,zabs)   #force coordinate on full arc              
        if plane$ = two,
          [
          result = force(xabs,xabs)   #force coordinate on full arc              
          result = force(zabs,zabs)   #force coordinate on full arc              
          ]
        ]
      if hel_2100 = one, pcirout2
      else, pcirout1

pcirout1        #Output to NC of circular interpolation
      pcan1, pbld, [if plane$ > 0, plane$ = 1, sgplane], sgcode, [if prv_sgplane <> sgplane, sgabsinc], pccdia, #, n$, `sgfeed
        pxout, pyout, pzout, [if HorizontalCellSystem <> 2, pcout], parc, feed, strcantext, scoolant, e$

pcirout2        #Output to NC of circular interpolation
      if (plane$ = zero & fmtrnd(zinc)<>0)
       | (plane$ =  one & fmtrnd(xinc)<>0)
       | (plane$ =  two & fmtrnd(yinc)<>0), phelout
      else, pcirout1

phelout         #Output to NC of helical interpolation
      if errorcheck = one, [if not(arccomp), pcompwarn, pCircleMillCutterCompAlarm, pHelixBoreCompWarn]
      if plane$ = zero,
        [
        result = nwadrs(strk, lead)
        lead = abs(zinc/sweep$*360)
        ]
      if plane$ = one,
        [
        result = nwadrs(stri, lead)
        lead = abs(xinc/sweep$*360)
        ]
      if plane$ = two,
        [
        result = nwadrs(strj, lead)
        lead = abs(yinc/sweep$*360)
        ]
      pcan1, pbld, [if plane$ > 0, plane$ = 1, sgplane], sgcode, [if prv_sgplane <> sgplane, sgabsinc], pccdia, #, n$, `sgfeed
        pxout, pyout, pzout, *lead, [if HorizontalCellSystem <> 2, pcout], parc, feed, strcantext, scoolant, e$
#EndRegion prapidout
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...