585,591 active members*
2,842 visitors online*
Register for free
Login
IndustryArena Forum > CAM Software > Mastercam > Coolant changes in post
Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2019
    Posts
    9

    Coolant changes in post

    I have been working on this post for a few years and am about completely finished, this is what I am spitting out now for our HAAS machine. Any help will be greatly appreciated.

    For flood coolant this is what I am putting out now

    O3521( 121-55-50-9352 R00 )
    ( DATE - JAN. 28 2019 - 14:55)
    ( N10 T1 | 3/8 SPOTDRILL | )
    G20
    G0 G17 G40 G49 G80 G90
    N10 T1 M6 ( 3/8 SPOTDRILL | TOOL - 1 | )
    G0 G90 G54 X-13. Y0. S5000 M3
    G43 H1 Z1.
    M8
    Z.1


    For coolant through this is what I am putting out now


    O3521( 121-55-50-9352 R00 )
    ( DATE - JAN. 28 2019 - 14:55)
    ( N10 T1 | 3/8 SPOTDRILL | )
    G20
    G0 G17 G40 G49 G80 G90
    N10 T1 M6 ( 3/8 SPOTDRILL | TOOL - 1 | )
    G0 G90 G54 X-13. Y0. S5000 M3
    G43 H1 Z1.
    M88
    Z.1

    For coolant through this is what I want, the spindle to turn on after the coolant.

    O3521( 121-55-50-9352 R00 )
    ( DATE - JAN. 28 2019 - 14:55)
    ( N10 T1 | 3/8 SPOTDRILL | )
    G20
    G0 G17 G40 G49 G80 G90
    N10 T1 M6 ( 3/8 SPOTDRILL | TOOL - 1 | )
    G0 G90 G54 X-13. Y0.
    G43 H1 Z1.
    M88
    S5000 M3
    Z.1

    I am pretty sure this is the section of the post that is doing this.

    var1 = 10#JD variable for toolchange block number
    pcom_moveb
    pcheckaxis
    c_mmlt$ #Multiple tool subprogram call
    #ptoolcomment-suppresed so tool comment comes up on same line as tool change not before JD 5/20/2016
    comment$
    pcan
    pbld, n$, *var1, *t$, sm06, ptoolcomment e$#add var1 for toolchange block number and tool comment JD
    pindex
    if mi1$ > one, absinc$ = zero
    pcan1, pbld, n$, *sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfcout,
    speed, *spindle, pgear, strcantext, e$
    pbld, n$, sg43, *tlngno$, pfzout, pstagetool, e$
    pbld, n$, scoolant, e$
    absinc$ = sav_absinc
    pbld, n$, sgabsinc, e$
    pcom_movea
    toolchng = zero
    c_msng$ #Single tool subprogram call

    I need to write something like if coolant = M88 / position machine without turning the spindle on, and turn the spindle on after the coolant.
    If coolant = M8 / position the machine and turn spindle on.
    Below is the coolant table. I am not sure which value to try and use

    if scool54 = 3
    if coolantx = 54
    if coolantx = three?

    I have tried many combinations over the last few hours but so far have gotten nowher

    # Coolant output code selection for X style coolant
    # Note: To enable X style coolant, click on the General Machine Parameters icon
    # in the Machine Definition Manager, Coolant tab, disable first check box
    # Output of X style coolant commands in this post is controlled by pcan, pcan1, & pcan2
    scool50 : "M8" #Coolant 1 on value
    scool51 : "M9" #Coolant 1 off value
    scool52 : "M7" #Coolant 2 on value
    scool53 : "M9" #Coolant 2 off value
    scool54 : "M88" #Coolant 3 on value
    scool55 : "M89" #Coolant 3 off value
    scool56 : "M8(Coolant4=ON)" #Coolant 4 on value
    scool57 : "M9(Coolant4=OFF)" #Coolant 4 off value
    scool58 : "M8(Coolant5=ON)" #Coolant 5 on value
    scool59 : "M9(Coolant5=OFF)" #Coolant 5 off value
    scool60 : "M8(Coolant6=ON)" #Coolant 6 on value
    scool61 : "M9(Coolant6=OFF)" #Coolant 6 off value
    scool62 : "M8(Coolant7=ON)" #Coolant 7 on value
    scool63 : "M9(Coolant7=OFF)" #Coolant 7 off value
    scool64 : "M8(Coolant8=ON)" #Coolant 8 on value
    scool65 : "M9(Coolant8=OFF)" #Coolant 8 off value
    scool66 : "M8(Coolant9=ON)" #Coolant 9 on value
    scool67 : "M9(Coolant9=OFF)" #Coolant 9 off value
    scool68 : "M8(Coolant10=ON)" #Coolant 10 on value
    scool69 : "M9(Coolant10=OFF)" #Coolant 10 off value
    scoolantx : "" #Target string



    thank you for bearing with me.
    Jerry

  2. #2
    Join Date
    Jan 2019
    Posts
    9
    I should say hello and it is my first time here. I won't be around too long. I just retired and plan on working for another 4 to 6 months and then leaving the trade. I have been doing this since I was 17 and it is now time to take it easy and try something different, but I am going to give this post one last going over before I call it quits and get it where I want it.

  3. #3
    Join Date
    Jan 2019
    Posts
    74
    Take the blocks that you want to kept for M88 and wrap them up in an IF statement like this:
    If scool54,
    [
    blah
    pbld, n$, scoolant, e$
    pbld, n$ speed, *spindle, pgear, strcantext, e$
    blah blah blah
    ]
    else,
    [
    however you want your m8 output
    ]


    Suggestion...never abbreviate your G/M codes. M08 should not be M8. On some machines searching for M8 will also select M88. Makes it a headache.

  4. #4
    Join Date
    Jan 2019
    Posts
    9
    I don't know the post language so for me it is trial and error with educated guesses. So far I have massaged it quite a bit to get what I want. Will try this and see how far I get.
    Thanx
    Jerry

  5. #5
    Join Date
    Jan 2019
    Posts
    74
    What version of MC?

  6. #6
    Join Date
    Jan 2019
    Posts
    9
    MC 2017, I have tried working with scool54, either I am not formatting properly or I am putting it in the wrong place etc. If you look at the code below and see where I typed changes start and changes end, that is the section I am changing

    psof$ #Start of file for non-zero tool number
    prv_tloffno$ = c9k
    pcuttype
    toolchng = one
    if ntools$ = one,
    [
    #skip single tool outputs, stagetool must be on
    stagetool = m_one
    !next_tool$
    ]
    pbld, n$, *smetric, "M31" e$ #Added M31 to turn conveyor on.
    pbld, n$, *sgcode, *sgplane, scc0, sg49, sg80, *sgabsinc, e$
    sav_absinc = absinc$
    if mi1$ <= one, #G92 Local Work coordinate system
    [
    absinc$ = one
    pfbld, n$, sgabsinc, *sg28ref, "Z0.", e$
    pfbld, n$, *sg28ref, "X0.", "Y0.", e$
    pfbld, n$, sg92, *xh$, *yh$, *zh$, e$
    absinc$ = sav_absinc
    ]
    if mi1$ = three | mi1$ = four, #G52 Work Shift
    [
    absinc$ = one
    pfbld, n$, sgabsinc, *sg28ref, "Z0.", e$
    pbld, n$, sg52, *xh$, *yh$, *zh$, e$
    if xh$ | yh$ | zh$, shft_flg = one
    else, shft_flg = zero
    absinc$ = sav_absinc
    ]

    MY CHANGES START HERE

    if scool54,
    [
    var1 = 10#JD variable for toolchange block number
    pcom_moveb
    pcheckaxis
    c_mmlt$ #Multiple tool subprogram call
    #ptoolcomment-suppresed so tool comment comes up on same line as tool change not before JD 5/20/2016
    comment$
    pcan
    pbld, n$, *var1, *t$, sm06, ptoolcomment e$#add var1 for toolchange block number and tool comment JD 5/20/2016
    pindex
    if mi1$ > one, absinc$ = zero
    pcan1, pbld, n$, *sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfcout,e$
    pbld, n$, sg43, *tlngno$, pfzout, pstagetool, e$
    pbld, n$, scoolant, e$
    pbld, n$ *speed, *spindle, pgear, strcantext, e$
    absinc$ = sav_absinc
    pbld, n$, sgabsinc, e$
    pcom_movea
    toolchng = zero
    c_msng$] #Single tool subprogram call

    else,

    [ var1 = 10#JD variable for toolchange block number
    pcom_moveb
    pcheckaxis
    c_mmlt$ #Multiple tool subprogram call
    #ptoolcomment-suppresed so tool comment comes up on same line as tool change not before JD 5/20/2016
    comment$
    pcan
    pbld, n$, *var1, *t$, sm06, ptoolcomment e$#add var1 for toolchange block number and tool comment JD 5/20/2016
    pindex
    if mi1$ > one, absinc$ = zero
    pcan1, pbld, n$, *sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfcout,
    *speed, *spindle, pgear, strcantext, e$
    pbld, n$, sg43, *tlngno$, pfzout, pstagetool, e$
    pbld, n$, scoolant, e$
    absinc$ = sav_absinc
    pbld, n$, sgabsinc, e$
    pcom_movea
    toolchng = zero
    c_msng$] #Single tool subprogram call

    CHANGES END HERE and the rest is next in the post

    ptlchg0$ #Call from NCI null tool change (tool number repeats)
    pcuttype
    toolchng0 = one
    pcom_moveb
    pcheckaxis
    !op_id$
    c_mmlt$ #Multiple tool subprogram call
    comment$
    pcan

    pbld, n$, sgplane, e$
    pspindchng
    pbld, n$, scoolant, e$
    if mi1$ = three | mi1$ = four, #Work coordinate shift
    [
    #pbld, n$, *sg28ref, "X0.", "Y0.", e$
    pbld, n$, sg52, *xh$, *yh$, *zh$, e$
    if xh$ | yh$ | zh$, shft_flg = one
    else, shft_flg = zero
    ]
    if mi1$ > one & workofs$ <> prv_workofs$,
    [
    sav_absinc = absinc$
    absinc$ = zero
    pbld, n$, sgabsinc, pwcs, e$# pfxout, pfyout, pfzout, pfcout, e$#removed sgabsinc pfxout pfyout pfzout(CHANGED 3-7-2015 JD-HAD ASTERIK IN FRONT)
    pbld, n$, pwcs, e$
    pe_inc_calc
    ps_inc_calc
    absinc$ = sav_absinc
    ]
    if cuttype = zero, ppos_cax_lin
    if gcode$ = one, plinout
    else, prapidout#/ put asterik in front to prevent axix movement after WCS callout in multipart program/axis movement now in subs
    pcom_movea
    toolchng0 = zero
    c_msng$ #Single tool subprogram call
    Last edited by dragonworks; 02-06-2019 at 09:37 PM.

  7. #7
    Join Date
    Jan 2019
    Posts
    9
    without any changes that section is as follows

    var1 = 10#JD variable for toolchange block number
    pcom_moveb
    pcheckaxis
    c_mmlt$ #Multiple tool subprogram call
    #ptoolcomment-suppresed so tool comment comes up on same line as tool change not before JD 5/20/2016
    comment$
    pcan
    pbld, n$, *var1, *t$, sm06, ptoolcomment e$#add var1 for toolchange block number and tool comment JD 5/20/2016
    pindex
    if mi1$ > one, absinc$ = zero
    pcan1, pbld, n$, *sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfcout,
    *speed, *spindle, pgear, strcantext, e$
    pbld, n$, sg43, *tlngno$, pfzout, pstagetool, e$
    pbld, n$, scoolant, e$
    absinc$ = sav_absinc
    pbld, n$, sgabsinc, e$
    pcom_movea
    toolchng = zero
    c_msng$ #Single tool subprogram call

  8. #8
    Join Date
    Jan 2019
    Posts
    9
    P.S.
    I don't know this language at all, thanx for putting up with me.
    I forgot to thank you.
    Thank You
    Jerry
    Last edited by dragonworks; 02-06-2019 at 09:37 PM.

  9. #9
    Join Date
    Jan 2019
    Posts
    9
    my programs come out looking like this
    %
    O2901( TEST )
    ( DATE - FEB. 06 2019 TIME - 3:15 PM )
    ( N10 T1 | 1/2 CARBIDE 3 FLUTE | )
    ( N20 T2 | 3/8 SPOT 90 DEGREE | )
    ( N30 T3 | #1 DRILL .228 | )
    ( N40 T4 | 1/4-20 FORM TAP | )
    G20 M31
    G0 G17 G40 G49 G80 G90
    N10 T1 M6 ( 1/2 CARBIDE 3 FLUTE | TOOL - 1 | )
    G0 G90 G54 X-13.06 Y-3.5 S7450 M3
    G43 H1 Z.1 T2
    M8
    G1 Z-.375 F101.
    G41 D1 X-12.935 F50.
    Y-3.125
    Y-.125
    Y.25
    G40 X-13.06
    G0 Z.1
    Y-3.5
    G1 Z-.375 F101.
    G41 D1 X-12.935 F50.
    Y-3.125
    Y-.125
    Y.25
    G40 X-13.06
    G0 Z.1
    M5
    M9
    G91 G28 Z0.
    G90 M01
    G0 G90 G53 Y0
    M00 (SPIN PART IN VISE-DO NOT RESET X AXIS)
    N20 T2 M6 ( 3/8 SPOT 90 DEGREE | TOOL - 2 | )
    G0 G90 G54 X-12.3438 Y-.875 S8000 M3
    G43 H2 Z1. T3
    M8
    Z.1
    G99 G81 Z-.118 R.1 F7.5
    Y-2.375
    X-9.125 Y-.875
    X-8.754 Y-1.6875
    X-7.5938 Y-2.8438
    X-5.625 Y-.875
    X-4.9063 Y-2.8438
    X-3.3148 Y-2.5018
    Y-.7482
    X-1.5612
    X-1.198 Y-1.625
    X-1.5612 Y-2.5018
    X-.4375 Y-3.
    Y-2.375
    Y-.875
    Y-.25
    X-3.2505 Y-2.967
    X-1.6255
    G80
    Z1.
    S7550 M3
    X-10.4688 Y-1.813 Z.375
    Z.1
    G99 G81 Z-.18 R.1 F8.5
    X-5.4688
    G80
    Z.375
    M5
    M9
    G91 G28 Z0.
    G90 M01
    N30 T3 M6 ( #1 DRILL .228 | TOOL - 3 | )
    G0 G90 G54 X-1.198 Y-1.625 S4000 M3
    G43 H3 Z.1 T4
    M8
    G99 G83 Z-.77 R.1 Q.1 F20.
    X-.4375 Y-.875
    Y-2.375
    G80
    M5
    M9
    G91 G28 Z0.
    G90 M01
    N40 T4 M6 ( 1/4-20 FORM TAP | TOOL - 4 | )
    G0 G90 G54 X-.4375 Y-2.375 S1000 M3
    G43 H4 Z.1 T1
    M8
    G99 G84 Z-.53 R.1 F50.
    Y-.875
    G80
    M5
    M9
    G91 G28 Z0.
    G0 G90 G53 Y0.
    M30
    %

  10. #10
    Join Date
    Jan 2019
    Posts
    9
    If I have the through coolant turned on I want it to look like the following

    O2901( TEST )
    ( DATE - FEB. 06 2019 TIME - 3:15 PM )
    ( N10 T1 | 1/2 CARBIDE 3 FLUTE | )
    ( N20 T2 | 3/8 SPOT 90 DEGREE | )
    ( N30 T3 | #1 DRILL .228 | )
    ( N40 T4 | 1/4-20 FORM TAP | )
    G20 M31
    G0 G17 G40 G49 G80 G90
    N10 T1 M6 ( 1/2 CARBIDE 3 FLUTE | TOOL - 1 | )
    G0 G90 G54 X-13.06 Y-3.5
    G43 H1 Z.1 T2
    M88
    S7450 M3
    G1 Z-.375 F101.
    G41 D1 X-12.935 F50.
    Y-3.125
    Y-.125
    Y.25
    G40 X-13.06
    G0 Z.1
    Y-3.5
    G1 Z-.375 F101.
    G41 D1 X-12.935 F50.
    Y-3.125
    Y-.125
    Y.25
    G40 X-13.06
    G0 Z.1
    M5
    M89
    G91 G28 Z0.
    G90 M01
    G0 G90 G53 Y0

  11. #11
    Join Date
    Jan 2019
    Posts
    9

    Re: Coolant changes in post

    Getting nowhere fast here, will have to move on and find another site.
    Thank You

Posting Permissions

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