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:

Zaffin_D

Verified Members
  • Posts

    374
  • Joined

  • Days Won

    1

Posts posted by Zaffin_D

  1. On ‎7‎/‎30‎/‎2018 at 2:52 AM, David Colin said:

    It can be done but as already said, best is to split in 2 ops. (or ask CNC a switch to calc rough passes with computer comp only...)

    IMHO it can cause serious issues tweaking a post that way... you can count passes number set in Mastercam GUI but if CNC changes/improves routines in a future release (as it's been done in 2018 if I remember correctly) you probably will need to be careful (I ve already been bitten...) 

    Another stuff to be aware: what if a user, one day, has great idea to post a toolpath with 'control' comp setting? It will make a crap part and a cutter broken...So don't forget to support that case in your post to output G41/G42.   

    Though I disagree that creating (and maintaining) two ops for this is the best solution, that's not why I'm responding.

    You said you've been bitten by a change CNC made before, was it a change made to MP.dll?  Can you shoot me an email about this?  I'd like to help if I can.

  2. That's not correct according to the documentation;

    Quote

    Make sure you follow these guidelines:
     The [STARTBIN] and [ENDBIN] keywords must each be on a separate line and
    start in the first column.
     The keywords must not appear inside a postblock.
     The keywords cannot be nested. You can, however, have multiple sets of
    unnested keywords.
     If the keywords appear in comments (after the # symbol), MPBinX ignores them.
     If the keywords do not occur in ordered, matched pairs, MPBinX ignores them.

     

    Please make sure to keep a backup of your post file!

  3. 13 hours ago, C^Millman said:

    Jeff, our job as programmers is to make the work practical, predicable and repeatable to run day in and day out and yes MP is very powerful and yes it can do some amazing things, but none of that is going to help the companies he works for recoup all the time he puts into projects like this that from my experience cannot reap benefit. This is a case of someone before him that didn't do their job correctly and adding all of these checks and balances will never replace real world experience. There are 100's of way sometimes to machine a part and in this case it might serve this purposes, but what about the other 99 cases? Error checking anything is always 10X t o100X the original work of doing the process. A slippery slop is just that and when you get away from practical knowledge and trust some thing to always error proof something the problem is you don't learn what is the best way to get the job done. I can run it through this post that has the 500 questions to ask me things to check for mistakes. What happens when the 501th or the 657th error comes through? When does it becomes enough to check all the wrong things and not enough to just do it right the 1st time? When you spend 20 minutes answering all the questions on something that is programmed correctly would only take 2 minutes where is the value in always checking when if the correct process were done and trained then there wouldn't be an error to being with? That is the slippery slope when the process becomes to top heavy the supporting of it becomes so labor intensive it creates a lack of concern or care because well I don't have to do it right because the error checks will catch my mistakes.

    I don't disagree, as you've seen my posts are as basic as it gets.  I'm sharing information, not just for PcRobotic, but for any one that has the same question in the future.

  4. My HASP is at the office, but I think you could set a flag to suppress the output.  Set the flag by checking the total number of passes against the number of passes completed.

    The total number of passes should be parameter 15560 + parameter 15380.  You can track the number of passes completed by incrementing a counter at null tool change if the op_id$ is the same.

    On night this week I'll bring my HASP home and work up an example.

    • Thanks 1
  5. Are you using Mastercam 2017 or later?  If so, you can use opinfo and do something like the below example in pheader$.

    stoolPathComment = opinfo(15239, 0)

    You'll have to initialize stoolPathComment somewhere in the post in order for the above line to work.  

    <LeftMargin>stoolPathComment : ""

    I usually set up a post block that I call whenever I start a new op.  The post your using probably has something comparable.

    #region Tool Path Comment
    
    fmt "OP NUMBER - "            4 opNumber
    fmt "TOOLPATH MAX Z DEPTH: "  3 toolpathZMin
    
    stoolPathComment : ""
    
    pToolPathComment
          opNumber = opinfo(15240, 0)
          stoolPathComment = opinfo(15239, 0)
          toolpathZMin= opinfo(19, 0)
          n$, scommentStart, *opNumber, [if stoolPathComment <> sBlank, "|", stoolPathComment], scommentEnd e$
          n$, scommentStart, *toolpathZMin, scommentEnd e$
    
    
    #endregion End Tool Path Comment

     

    Hope that helps,

    Jeff

    • Like 1
  6. This is not an Agie vision machine.  The New CUT series uses GF's new CUT 2 HMI and is closer to the Charmille side of the family.

    Mastercam doesn't have a post that outputs a job (.mjb) file.  However, if you are willing to do the sequencing at the machine you can use a post that generates a Charmille ISO file.  That's how I did it when I worked for GF, but I was on the milling side of the family, so I didn't get much wire time.

    Thanks,

    Jeff

  7. In hindsight, a better way would be to use the tt_op_id$ value as the 'key' for the line number in the stack.

    
    #Start Array
    stackOpID : 0
    stackLine : 0
    #End Array
    
    pushResult : 0
    
    fstack 1 2
    
    ptooltable$
          if (tt_count$ = TOOL_NOT_OUTPUT@),
          [
            return = fprm(ONE@, OP_PARAMETERS@)
            toolDiameter = rparsngl(s1013, TWO@)
            stoolString = ucase(stoolString)
            n$, scommentStart, *tt_tool$, "|", *tt_tlngno$, "|", stoolString, "|", *toolDiameter, "|", pGetToolsMinimumZ(tt_tool$), no_spc$, scommentEnd e$
            stackOpID = tt_op_id$
            stackLine = tt_tlngno$  # This could be any value you'd like, it is now 'keyed' to the op_id$ value in the stack
            stackOPID = push(1, pushResult, 0)
          ]
    

    We'd also have to make a slight change to our pGetLineNumber post block

    #Start Array
    stackSize  : 0
    popResult  : 0
    #End Array
    
    #Start Array
    opID       : 0
    lineNumber : 0
    #End Array
    
    currentOpID : 0
    
    fmt "N"    4 lineNumber
    
    pGetLineNumber(currentOpID)  # Pass the current op_id$ value to pGetLineNumber as an argument; pGetLineNumber(op_id$) 
          stackSize = pop(1, popResult, 0)
          while (stackSize > 0),
          [
            opID = pop(1, stackSize, 5)
            if (currentOpID = opID),
            [
              stackSize = 0
              *lineNumber, e$
            ]
            else, stackSize = stackSize - 1
          ] 
    • Like 1
  8. 1 hour ago, C^Millman said:

    All ears and would love to see an example. Please point me to a Mastercam MP post that has been updated to use this?

    I think this would work with some minor tweaks (depending on what you wanted the line numbers to be).  In this example we'll make them the offset.

    #region Tooltable
    
    s1013            : ""
    stoolString      : ""
    
    fprmtbl 1 2
            1013   s1013
            10094  stoolString
    
    fmt "DIAMETER - "    3 toolDiameter
    fmt "MAX Z DEPTH: "  3 toolZMin
    fmt "TOOL NUMBER - " 4 tt_tool$
    fmt "N"              4 tt_tlngno$
    
    #Start Array
    stackTool : 0
    stackLine : 0
    #End Array
    
    pushResult : 0
    
    fstack 1 2
    
    ptooltable$
          if (tt_count$ = TOOL_NOT_OUTPUT@),
          [
            return = fprm(ONE@, OP_PARAMETERS@)
            toolDiameter = rparsngl(s1013, TWO@)
            stoolString = ucase(stoolString)
            n$, scommentStart, *tt_tool$, "|", *tt_tlngno$, "|", stoolString, "|", *toolDiameter, "|", pGetToolsMinimumZ(tt_tool$), no_spc$, scommentEnd e$
            stackTool = tt_tool$
            stackLine = tt_tlngno$
            stackTool = push(1, pushResult, 0)
          ]
    
    opZMin       : 0
    tool         : 0
    toolIndex    : 0
    opToolNumber : 0
    
    pGetToolsMinimumZ(tool)
          toolIndex = ZERO@
          toolZMin = ZERO@
          opToolNumber = opinfo(10002, toolIndex)
          while (opToolNumber <> QUERY_INVALID@),
          [
            if (opToolNumber = tool),
            [
              opZMin= opinfo(19, toolIndex)
              if (opZMin < toolZMin),
              [
                toolZMin = opZMin
              ]
            ]
            toolIndex = toolIndex + ONE@
            opToolNumber = opinfo(10002, toolIndex)
          ]
          *toolZMin
    
    #endregion End Tooltable

     

    Once you have the tool numbers and the line numbers in the stack, you could use something like the below post block to write them out.

    #Start Array
    stackSize  : 0
    popResult  : 0
    #End Array
    
    #Start Array
    toolNumber : 0
    lineNumber : 0
    #End Array
    
    fmt "N"    4 lineNumber
    
    matchFound : no$
    
    pGetLineNumber
          matchFound = no$
          stackSize = pop(1, popResult, 0)
          while (stackSize > 0),
          [
            toolNumber = pop(1, stackSize, 5)
            if (t$ = toolNumber), matchFound = yes$
            if (matchFound),
            [
              stackSize = 0
              *lineNumber, e$
            ]
            else, stackSize = stackSize - 1
          ]
    

    This would need to be refined a bit to meet your goals.  I'd be happy to talk more about solving this problem, send me an email if you'd like.

     

    • Like 1
  9. param12207 is initialized the same way you would initialize any non-global variable in MP;  "(left margin)param12207 : 0"

    Try this; 

    1. Open a new file and load your machine - DO NOT create any geometry 
    2. Press the F9 key to display the axis lines
    3. Create a circle mill toolpath, and select the origin point for the geometry 
    4. Under the toolpath's cut parameters, enter a diameter in the "Circle diameter" text box
    5. Post the file and see if the diameter entered in step 4  is present in the posted file.

     

    • Thanks 1
    • Like 1
  10. 2 hours ago, C^Millman said:

    Awesome got an example of doing this?

    Yes, it's quite simple really.

    First, find the initialization for tooltable$ and comment it out.  Once commented out, replace it with x_tooltable$ and initialize it to 1

     #tooltable$  : 3     #Removed, no longer needed with x_tooltable$
    x_tooltable$  : 1     #

    Next, find and comment out pwrtt$ and pwrttparam$.  With the enhanced tool table they are no longer needed.

    #pwrtt$          #Pre-read NCI file
    #      if tool_info > 1 & t$ > 0 & gcode$ <> 1003, ptooltable
    
    #pwrttparam$     #Pre-read parameter data
    #      #"pwrttparam", ~prmcode$, ~sparameter$, e$
    #      if prmcode$ = 15346, comp_type = rpar(sparameter$, 1) #Cutter compensation type - 0=computer, 1=control, 2=wear, 3=reverse wear, 4=off
    #      if prmcode$ = 10010, xy_stock = rpar(sparameter$, 1)  #Capture stock to leave (XY)
    #      if prmcode$ = 10068, z_stock = rpar(sparameter$, 1)   #Capture stock to leave (Z)

    Now we need to merge the logic from pwrtt$ and pwrttparam$ into a new post block, ptooltable$.

    So, before we had the ptooltable post block that was called from pwrtt$.

    #ptooltable      #Tooltable output
    #      sopen_prn, *t$, sdelimiter, pstrtool, sdelimiter, *tlngno$,
    #        [if comp_type > 0 & comp_type < 4, sdelimiter, *tloffno$, sdelimiter, *scomp_type, sdelimiter, *tldia$],
    #        [if xy_stock <> 0 | z_stock <> 0, sdelimiter, *xy_stock, sdelimiter, *z_stock],
    #        sclose_prn, e$
    #      xy_stock = 0  #Reset stock to leave values
    #      z_stock = 0   #Reset stock to leave values

    Now we have everything in the new post block, ptooltable$ (note the dollar sign)

    ONE@ : 1
    
    s1013 : ""
    fmt "TOOL DIA. - " 1   toolDiameter
    
    ptooltable$
          if tt_count$ = ONE@,
          [
            comp_type = opinfo(15346, 0)
            xy_stock = opinfo(10010, 0)
            z_stock = opinfo(10068, 0)
            s1013 = opinfo(1013, 0)
            toolDiameter = rparsngl(s1013, 2)
            sopen_prn, *tt_tool$, sdelimiter, pstrtool, sdelimiter, *tt_tlngno$,
              [if comp_type > 0 & comp_type < 4, sdelimiter, *tt_offset$, sdelimiter, *scomp_type, sdelimiter, *toolDiameter],
              [if xy_stock <> 0 | z_stock <> 0, sdelimiter, *xy_stock, sdelimiter, *z_stock],
              sclose_prn, e$
            ]

    We also have to change the pstrtool post block to use the new opinfo function. 

    stoolString : ""
    
    pstrtool
          stoolString = opinfo(10094, 0)
          if stoolString <> sblank,
          [
            stoolString = ucase(stoolString)
            stoolString
          ]

     

    What that done, we can call x_tooltable$ from any post block and start tool table processing.

    • Thanks 1
  11. If  you are in 2017/2018/2019, you don't need a buffer to do this.  The new tool table (x_tooltable$) can be called from any post block and is much more efficient than the old pwrtt$ method.

    Implementing x_tooltable$ in your post may take some time, but it's a much faster way to access tool table data.

    • Thanks 1
    • Like 1

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