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:

fagor post bug


Recommended Posts

hi all, I have an interesting bug in my fagor post processor I can't seem to iron out on my own. 

after a canned drill cycle (any drill cycle) all of the z values get posted as I values. 

example:

N190 Z.3
N200 G83 G99 Z.3 I-.0333 J9 F12.
N210 G80
N220 S5000 M03
N230 X-2.0493 Y-.3918 
N240 G01 I.003 F10.  <-----this should read G01 Z.003 F10.  >
N250 X-2.0553 Y-.4315 F48.
N260 G03 X-2.0557 Y-.4375 I.0398 J-.006

I've tried tracing it through the debugger, but watchlists don't work, so I haven't been able to get very far with it. I've also eliminated as many variables as I could, such as not having the rpm change, feed rate change, it will even do it after a tool change. 

any help is appreciated in this. thank you

fgor.PST

Link to comment
Share on other sites

This is a pretty old Post Processor (2002), and was built by In-House Solutions. (In-House runs this forum where we are posting...)

Someone added logic in the 'Common Drill Preparation section' ( the 'pdrlcommonb' Post Block), which "assigns a new Prefix Address String to the 'zabs' and 'zinc' variables.

I'm not sure why they did this, other than to customize some Drilling output from one of the Drill Post Blocks. However, what you asked for was help fixing your problem, which I'm certainly happy to do.

First, I'd recommend when you are editing your Post Processors, to always use the Mastercam Code Expert Text Editor. If you open the Editor, and then do a "File Open", and change the "File Type" to "Post File (*.pst; *.set; *.psm; *.mcpost; *.mcdpost)", then the Code Expert Editor will recognize the PST file as a Mastercam Post. This gives you all of the Variables, Strings, Operators, and Functions, which are "auto-highlighted" for you. In addition, you get "auto-complete" function which shows you all of the predefined Variables and Post Blocks. This is a huge help when making Post Edits.

Here is how your Post appears to me, inside the Code Expert Editor:

image.thumb.png.12308b3e2728a1ddf4bd38af85d6f41d.png

 

The two lines I've highlighted, are the ones where 'zabs' and 'zinc' are being assigned new Prefix String Addresses.

So, how do we fix it?

I don't want to break the logic they added (I want the customization in the Drill Cycles to stay there), so we are going to add some code to fix the problem.

In Code Expert, open your Post, and search for 'pcanceldc$'. This is the "cancel drill cycle" Post Block, and is called at the very end of all Drill Cycle output.

Make the following changes to your Post Block.

Original:

pcanceldc$       #Cancel canned drill cycle
      result = newfs (three, zinc)
      z$ = initht$
      if cuttype = one, prv_zia = initht$ + (rotdia$/two)
      else, prv_zia = initht$
      pxyzcout
      !zabs, !zinc
      prv_gcode$ = zero
      if cool_zmove = yes$ & (nextop$=1003 | (nextop$=1011 & t$<>abs(nexttool))), coolant$ = zero
      pcan
      if drillcyc$ <> 8, pcan1, pbld, n$, "G80", scoolant, strcantext, e$
      if use_pitch & tapflg = 1, pbld, n$, "G94", e$
      pcan2
      tapflg = 0

Here is the modified Post Block, with the fixes made:

 

pcanceldc$       #Cancel canned drill cycle
      result = newfs (three, zinc)
      z$ = initht$
      if cuttype = one, prv_zia = initht$ + (rotdia$/two)
      else, prv_zia = initht$
      pxyzcout
      !zabs, !zinc
      prv_gcode$ = zero
      if cool_zmove = yes$ & (nextop$=1003 | (nextop$=1011 & t$<>abs(nexttool))), coolant$ = zero
      pcan
      if drillcyc$ <> 8, pcan1, pbld, n$, "G80", scoolant, strcantext, e$
      if use_pitch & tapflg = 1, pbld, n$, "G94", e$
      pcan2
      tapflg = 0
      result = nwadrs(s_z_pre$, zabs)
      result = nwadrs(s_z_pre$, zinc)

 

Give that a try. I did zero testing on this fix, but I've modified enough Posts to know where to look for the problem, and I found a 'nwadrs' function, just as I suspected. 

 

  • Like 1
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...