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