Post processor Misc. Values switch placement


Results 1 to 6 of 6

Thread: Post processor Misc. Values switch placement

  1. #1
    Registered
    Join Date
    Oct 2017
    Location
    United States
    Posts
    3
    Downloads
    0
    Uploads
    0

    Default Post processor Misc. Values switch placement

    I'm trying to make a switch in the Misc. Values (Misc Integers to be precise), for calling up the tool breakage detection probe routine. It is successful, however it is placing the code at the end of the prior tool, rather than the one I am changing the misc. integer in. Here is the code I'm inserting:

    if mi5$ = 1,
    [
    pbld, n$, "G65 P9023 A24." *t$ "H.01 (CHECK FOR BROKEN TOOL)", e$
    ]

    I am putting this in the "pretract (end of toolpath, tool change)" section of the post.

    It works great if I only have one operation, this is what I get:

    O0051 (TEST)
    N1 (MATERIAL - ALUMINUM 6061)
    N2 (T12 - DR 3.3MM - H12 D12)
    N3 G0 G17 G20 G90
    N4 T12 M6 (DR 3.3MM)
    N5 (DRILL OTHER HOLES)
    N6 (STAGING NEXT TOOL)
    N7 S10000 M3
    N8 G187 P3 E250
    N9 G59 X.7579 Y.3563
    N10 G43 H12 Z.1
    N11 M5
    N12 M88
    N13 M3
    N14 G4 P1.5
    N15 G99 G81 Z-.75 R.1 F45.
    N16 Y1.1437
    N17 X1.3484
    N18 Y.3563
    N19 X6.9783
    N20 Y1.1437
    N21 X7.5689
    N22 Y.3563
    N23 X10.7185
    N24 Y1.1437
    N25 X11.8996
    N26 Y.3563
    N27 G80
    N28 M5
    N29 M89
    N30 M74
    N31 M84
    N32 M89
    N33 G53 G0 Z0.
    N34 G65 P9023 A24. T12 H.01 (CHECK FOR BROKEN TOOL)
    N35 G53 X-60. Y0.
    N36 M30



    however, when I have more than one operation, I get this:

    O0051 (TEST)
    N1 (MATERIAL - ALUMINUM 6061)
    N2 (T18 - DR 4.2MM - H18 D18)
    N3 (T12 - DR 3.3MM - H12 D12)
    N4 G0 G17 G20 G90
    N5 T18 M6 (DR 4.2MM)
    N6 (DRILL PIN HOLES)
    N7 T12 (STAGING NEXT TOOL)
    N8 S10000 M3
    N9 G187 P3 E250
    N10 G59 X10.7185 Y.75
    N11 G43 H18 Z.1
    N12 M5
    N13 M88
    N14 M3
    N15 G4 P1.5
    N16 G99 G81 Z-.75 R.1 F45.
    N17 X11.8996
    N18 G80
    N19 M5
    N20 M89
    N21 M74
    N22 M84
    N23 M89
    N24 G53 G0 Z0.
    N25 G65 P9023 A24. T12 H.01 (CHECK FOR BROKEN TOOL)
    N26 M1
    N27 G0 G17 G20 G90
    N28 T12 M6 (DR 3.3MM)
    N29 (DRILL OTHER HOLES)
    N30 T18 (STAGING NEXT TOOL)
    N31 S10000 M3
    N32 G187 P3 E250
    N33 G59 X.7579 Y.3563
    N34 G43 H12 Z.1
    N35 M5
    N36 M88
    N37 M3
    N38 G4 P1.5
    N39 G99 G81 Z-.75 R.1 F45.
    N40 Y1.1437
    N41 X1.3484
    N42 Y.3563
    N43 X6.9783
    N44 Y1.1437
    N45 X7.5689
    N46 Y.3563
    N47 X10.7185
    N48 Y1.1437
    N49 X11.8996
    N50 Y.3563
    N51 G80
    N52 M5
    N53 M89
    N54 M74
    N55 M84
    N56 M89
    N57 G53 G0 Z0.
    N58 G65 P9023 A24. T12 H.01 (CHECK FOR BROKEN TOOL)
    N59 G53 X-60. Y0.
    N60 M30

    As you can see, it is inserting the line at the end of the prior operation, although it is still grabbing the proper tool number. It is also putting the line at the end of the program.

    I have tried every combination of moving it around, in different sections of the post, and I can't find anything that works. Any ideas? I also had the same problem in the past with a forced table front and center and M0 switch, I ended up just dealing with it. I would like to fix this if possible.

    TIA!!










    Similar Threads:


  2. #2
    Flies Fast Superman's Avatar
    Join Date
    Dec 2008
    Location
    Antarctica
    Posts
    3110
    Downloads
    0
    Uploads
    0

    Default Re: Post processor Misc. Values switch placement

    I wouldn't place it in pretract, as it is called up at the end of the tool in use .... not in between ops that use the same tool

    I'd consider a separate postblock, so it can be easily corrected and also placed independently
    ie
    Code:
    ptoolbrkchk        # tool breakage check
          if MI5$>0, [
             sav_spc = spaces$
             spaces$ = 1
             absinc$ = zero
             gcode$ = zero
             pbld, n$, "G53 Z0.", e$
             pbld, n$, "G65 P9023 A24.", *t$, "H.01 (CHECK FOR BROKEN TOOL)", e$
             spaces$ = sav_spc
               ]
    Placement could be at the top of "peof$" & at top of "ptlchg$"
    - so for a single tool, peof$ would look at MiscInt #5
    - for multiple tools, the ptlchg$ would look for the setting, last tool would look when the peof$ is executed

    Code:
    peof$            #End of file for non-zero tool
          ptoolbrkchk
          pretract
          comment$
          #absinc$ = zero
          #pbld, n$, *sgcode, *sgabsinc, protretinc, e$
          if stagetool = 1 & stagetltype = 2, pbld, n$, *first_tool$, e$
          n$, "M30", e$
          mergesub$
          clearsub$
          mergeaux$
          clearaux$
          "%", e$

    Code:
    ptlchg$          #Tool change
          ptoolbrkchk
          pcuttype
          toolchng = one
          if mi1$ = one, #Work coordinate system
            [
            pfbld, n$, *sg28ref, "X0.", "Y0.", e$
            pfbld, n$, sg92, *xh$, *yh$, *zh$, e$
            ]
          if prog_stop = 1, pbld, n$, *sm01, e$
          if prog_stop = 2, pbld, n$, *sm00, e$
          "()", e$

    Now.... you need to set your default MiscInt#5 =0, so that it doesn't do a tool check after each operation, & set it to =1 only for the operation you want checked.......
    ....... we have not placed ptoolbrkchk in ptlchg0$, so if that tool is used in a following op...... it may not gauge check, ptoolbrkchk may also need to be placed in this postblock (ptlchg0$)

    happy proving off



  3. #3
    Registered
    Join Date
    Oct 2017
    Location
    United States
    Posts
    3
    Downloads
    0
    Uploads
    0

    Default Re: Post processor Misc. Values switch placement

    Thank you for the response, I appreciate it. Unfortunately, that is having the same result. It is still placing the line of code prior to the actual tool coming up, exactly as in the example I posted. It seems as though it is looking ahead at the future state of mi5, and applying it before the tool path. I'm wondering if there is a way to clear out the variable? I know I could just declare it as 0, but then I'm not sure when it would pick it back up again.


    Quote Originally Posted by Superman View Post
    I wouldn't place it in pretract, as it is called up at the end of the tool in use .... not in between ops that use the same tool

    I'd consider a separate postblock, so it can be easily corrected and also placed independently
    ie
    Code:
    ptoolbrkchk        # tool breakage check
          if MI5$>0, [
             sav_spc = spaces$
             spaces$ = 1
             absinc$ = zero
             gcode$ = zero
             pbld, n$, "G53 Z0.", e$
             pbld, n$, "G65 P9023 A24.", *t$, "H.01 (CHECK FOR BROKEN TOOL)", e$
             spaces$ = sav_spc
               ]
    Placement could be at the top of "peof$" & at top of "ptlchg$"
    - so for a single tool, peof$ would look at MiscInt #5
    - for multiple tools, the ptlchg$ would look for the setting, last tool would look when the peof$ is executed

    Code:
    peof$            #End of file for non-zero tool
          ptoolbrkchk
          pretract
          comment$
          #absinc$ = zero
          #pbld, n$, *sgcode, *sgabsinc, protretinc, e$
          if stagetool = 1 & stagetltype = 2, pbld, n$, *first_tool$, e$
          n$, "M30", e$
          mergesub$
          clearsub$
          mergeaux$
          clearaux$
          "%", e$

    Code:
    ptlchg$          #Tool change
          ptoolbrkchk
          pcuttype
          toolchng = one
          if mi1$ = one, #Work coordinate system
            [
            pfbld, n$, *sg28ref, "X0.", "Y0.", e$
            pfbld, n$, sg92, *xh$, *yh$, *zh$, e$
            ]
          if prog_stop = 1, pbld, n$, *sm01, e$
          if prog_stop = 2, pbld, n$, *sm00, e$
          "()", e$

    Now.... you need to set your default MiscInt#5 =0, so that it doesn't do a tool check after each operation, & set it to =1 only for the operation you want checked.......
    ....... we have not placed ptoolbrkchk in ptlchg0$, so if that tool is used in a following op...... it may not gauge check, ptoolbrkchk may also need to be placed in this postblock (ptlchg0$)

    happy proving off




  4. #4
    Flies Fast Superman's Avatar
    Join Date
    Dec 2008
    Location
    Antarctica
    Posts
    3110
    Downloads
    0
    Uploads
    0

    Default Re: Post processor Misc. Values switch placement

    Put up your post, something is not right
    ... your 2nd example looks a little bit cut_&_pasted
    .... Header codes repeated ( N4 & N27 lines )

    It looks like a Generic Fanuc 3-axis post ( +mods ) ... for what machine control ?



  5. #5
    Registered
    Join Date
    Oct 2017
    Location
    United States
    Posts
    3
    Downloads
    0
    Uploads
    0

    Default Re: Post processor Misc. Values switch placement

    Those lines are called before each tool, in case of mid-program start. It is a Generic post, but Haas, not Fanuc.

    Quote Originally Posted by Superman View Post
    Put up your post, something is not right
    ... your 2nd example looks a little bit cut_&_pasted
    .... Header codes repeated ( N4 & N27 lines )

    It looks like a Generic Fanuc 3-axis post ( +mods ) ... for what machine control ?




  6. #6
    Flies Fast Superman's Avatar
    Join Date
    Dec 2008
    Location
    Antarctica
    Posts
    3110
    Downloads
    0
    Uploads
    0

    Default Re: Post processor Misc. Values switch placement

    Ok, just rethinking, when pretract is executed, the next tool # is already placed into *t$. We need to adjust a little by saving the tool # at toolchange into another string

    Code:
    # --------------------------------------------------------------------------
    # Toolchange / NC output Variable Formats
    # --------------------------------------------------------------------------
    fmt  T  4   t$          #Tool number
    fmt  T  4   first_tool$ #First tool used 
    fmt  T  4   next_tool$  #Next tool used  
    fmt  D  4   tloffno$    #Diameter offset number
    fmt  H  4   tlngno$     #Length offset number
    fmt  G  4   g_wcs       #WCS G address
    fmt  P  4   p_wcs       #WCS P address
    fmt  S  4   speed       #Spindle Speed
    fmt  M  4   gear        #Gear range
    fmt  T  4   sav_t$          #Tool number in spindle
    
    
    #in psof and ptlchg$ after the toolchanges ( before any machine movements )
          pbld, n$, sm06, *t$, ptoolcomment, e$
          sav_t$ = t$
          pbld, n$, pstagetool, e$
          "()", e$
    You would still use ptoolbrkchk in the locations I showed earier



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Post processor Misc. Values switch placement

Post processor Misc. Values switch placement