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:

Probing


Recommended Posts

So im about to start working with our reseller on getting probing macros tied into a custom drill cycle...

 

Any tips, warnings, or no-nos to watch out for?

 

99% of our probing is done through mazatrol at the moment so im fairly green on running the renishaw sub programs.

Link to comment
Share on other sites

Not to take anything away from your reseller, but point them to these topics.

 

http://www.emastercam.com/board/index.php?showtopic=28834

www.emastercam.com/board/index.php?showtopic=31183

 

 

Here is something from an 08 Post and and Zoober dialed down:

# ---------------------------------------------------------------------
# Macro Variables as I need them for Probing using Drill Cycles
# ---------------------------------------------------------------------
sequal    "="      #Equal Sign
spound    "#"      #Pound Sign
sminus    "-"      #Minus Sign
sadd      "+"      #Addition Sign
sdivide   "/"      #Division Sign
smultiply "*"      #Multiply Sign
seq       EQ       #Equal Call
sne       NE       #Not Equal To Call
sgt       GT       #Greater Than to Call
slt       LT       #Less Than Call
sge       GE       #Is Great than or Equal to Call
sle       LE       #Is Less than or Equal to Call 
sin       SIN      #Sine Math
scos      COS      #Cosine Math
stan      TAN      #Tangent Math
satan     ATAN     #ArcTangent Math
scos      ACOS     #ArcCosine Math
sqrt      SQRT     #Sqaure Root Math
sabs      ABS      #Absoulte Value
sbin      BIN      #Bin
sbcd      BCD      #Bcd
sround    ROUND    #Round to the Nearest Whole Number
sfix      FIX      #Use for Cutting away any Decimal Numbers
sfup      FUP      #Counting Decimal Digits as one's
sln       LN       #Natural Logarithm
sexp      EXP      #Exponent  
sbracketopen  "["  #Open Bracket
sbracketclose "]"  #Close Bracket
sif       IF       #If Call
sgoto     GOTO     #Goto Call
swhile    WHILE    #While Call
sdo       DO       #Do Call
sor       OR       #Or Call
sand      AND      #And Call
smod      MOD      #Surplus Math
sdprint   DPRNT    #Data Output in from Probing Cycles
sfeature  FEATURE  #Comments for Probing of Features
sm100     100      #Macro Varaible 100 for Spindle Tranfer Operation
sm150     150      #Macro Variable 150 for Math Functions in C Axis Aling Macro
sm151     151      #Macro Variable 151 for Math Functions in C Axis Aling Macro
sm152     152      #Macro Variable 152 Math Functions in C Axis Aling Macro
sm5021    5021     #Machine Postion X Axis Variable
sm5022    5022     #Machine Postion Y Axis Variable 
sm5023    5023     #Machine Postion Z Axis Variable
sm5024    5024     #Machine Postion B Axis Variable
sm5025    5025     #Machine Postion C Axis Varaible for Main Spindle
sm5221    5221     #Workoffset Machine Postion X Axis Variable
sm5222    5222     #Workoffset Machine Postion Y Axis Variable 
sm5223    5223     #Workoffset Machine Postion Z Axis Variable
sm5224    5224     #Workoffset Machine Postion B Axis Variable
sm5225    5225     #Workoffset Machine Postion C Axis Varaible for Main Spindle

# --------------------------------------------------------------------------
# Probing String Varaibles Put here to keep post cleaner
# --------------------------------------------------------------------------
strg659730   "G65P9730" #Printing Macro Call 
strg659732   "G65P9732" #Offset Update Macro 
strg659810   "G65P9810" #Probe Protect Cycle 
strg659811   "G65P9811" #XYZ Single Surface Measure 
strg659812   "G65P9812" #Web / Pocket Measure 
strg659814   "G65P9814" #Bore / Boss
strg659815   "G65P9815" #Internal Corner
strg659816   "G65P9816" #External Corner
strg659817   "G65P9817" #4th Axis X measure - Horiziontal
strg659818   "G65P9818" #4th Axis Y Measure - Horiziontal
strg659819   "G65P9819" #Bore / Boss on PCD
strg659820   "G65P9820" #Stock Allowance Measure
strg659821   "G65P9821" #Angle Single Surface Measure
strg659822   "G65P9822" #Angle Web / Pocket Measure
strg659823   "G65P9823" #3-Point Bore / Boss Measure
strg659834   "G65P9834" #Feature to Feature Measure

# --------------------------------------------------------------------------
# Probe Format Statements
# --------------------------------------------------------------------------
fmt  Z  2  prorefht     #Z Rapid Position for Rapid
fmt  Z  2  prnrefht     #Z clearence for Protect Cycle
fmt  Z  2  zbossdep     #Z Position for Probing
fmt  D  2  diadwell     #P9614 Bore/Boss Measurement Dia call out
fmt  C  2  pcddia       #P9819 Bolt Circle Diameter for Measurement
fmt  K  2  zpcddep      #P9819 Z Depth if doing Bores for a Bolt Circle Measurement 
fmt  R  2  radclear     #Radius Clearance Postive for Od and Negative for Id
fmt  S  4  offupdate    #Used to Fixture Offsets
fmt  Y  2  cyspan       #Used for Across Distance
fmt  H  2  feattol      #Tolerance of Feature being Measured
fmt  T  4  toolupdate   #Used for Updating Tool Offsets
fmt  M  2  trueposzone  #True Position Tolerenance Zone
fmt  B  2  cangtoler    #C axis Tolerance for C-Axis Align Cycle
fmt  B  2  corn_angtoler#Angle Tolerance for Internal Corner if not 90 deg corner
fmt  Q  2  covertrav    #C Axis Overtravel for Probe Amount
fmt     2  drl_prm1$    #Tolerance Vaule for Repeat Loop in Post
fmt  X  2  drl_prm2$    #Size to Measure for P9812 Cycle X axis
fmt  Y  2  drl_prm3$    #Size to Measure for P9812 Cycel Y axis
fmt  W  4  drl_prm10$   #Print Variable for Increment or Reset
fmt     30 drl_prm6$    #GOTO statement Number to use
fmt  X  2  xsinsurf     #Single Surface for X
fmt  Y  2  ysinsurf     #Single Surface for Y
fmt  Z  2  zsinsurf     #Single Surface for Z
fmt  Z  2  zcorn        #Corner Probing for Z
fmt  X  2  xcorn        #Corner Probing for X
fmt  Y  2  ycorn        #Corner Probing for Y
fmt  I  2  icorn        #Corner Probing for I
fmt  J  2  jcorn        #Corner Probing for J
fmt     2  xdcorn       #Move amount for Corner Cycles
fmt     2  ydcorn       #Move amount for Corner Cycles
fmt  A  2  apcdang      #Angle for 1st Hole on PCD P9819 Measure Cycle
fmt  H  2  pcdholtol    #Tolerance for Holes in Bolt Hole Circle

# --------------------------------------------------------------------------
# Probe Varabiles Defined to Use with Drill Cycles
# --------------------------------------------------------------------------
prorefht = refht$        #Z Rapid Position for Rapid
prnrefht = tosz$         #Z Clearence for Protect Cycle
diadwell = dwell$  	 #P9814 Bore/Boss Measurement Dia call out
radclear = retr$         #P9814 Bore/Boss R Postive or Negative for clearance on Boss use Postive on Bore Use Negtive
feattol = shftdrl$       #P9811 Single Surface Measure Toleracne of Surface you are Measuring
zbossdep = depth$        #P9814 Bore/Boss Section Default to Boss use 1 to Make it A Bore Measure Cycle
zpcddep = depth$         #P9819 Bolt Circle Measurement Depth for Id Measurement
zsinsurf = depth$        #P9811 Z Axis Single Surface Use
zcorn = depth$           #P9815 Z Axis Corner Probing
cyspan = dwell$          #Used for Across Distance
jcorn = dwell$           #Used for Internal Corner
icorn = retr$            #Used for Internal Corner 
offupdate = peckclr$     #Used to Update Workoffsets if no Vaule is Used Nothing is Posted Out
trueposzone = peck2$     #Used for True Position Callout if no Vaule is Used Nothing is Posted Out
toolupdate = peck1$      #Used for Tooloffset Update to a Known Feature if No Value is Used Nothing is Posted Out
cangtoler = peck1$       #Used for C Axis Tolance in 4th Axis Measurements
corn_angtoler = peck1$   #Used for Internal Corner Angle Tolance
covertrav = peck2$       #Used for C Axis Overtravel Adjustment and setting in Cycle
pcddia = peck1$          #Used for Bolt Hole Circle on PCD P9819 Cycle
apcdang = drl_prm1$      #Used for Angle of 1st Hole on PCD P9819 Cycle 
xdcorn = drl_prm2$       #Used for Distance of Safe Position in X for Corner Cycles
ydcorn = drl_prm3$       #Used for Distance of Safe Position in Y for Corner Cycles

pdrlcst$         #Custom drill cycles 8 - 19 (user option)
      #Use this postblock to customize drilling cycles 8 - 19
      if drillcyc$ = 8, #XYZ Single Surface Measure 
           [
           pdrlcommonb
           if drl_prm2$ <> 0 & drl_prm3$ = 0, #X Axis Single Surface Probing
                [
                xsinsurf = (xout + drl_prm2$)
                pbld, n$, *strg659810, *xsinsurf,  e$
                pbld, n$, *strg659810, *prorefht, e$
                pbld, n$, *strg659810, *zsinsurf, e$
                pbld, n$, *strg659811, *xout, [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *zsinsurf, e$
                pbld, n$, *strg659810, *xsinsurf,  e$
                pbld, n$, *strg659810, *prorefht, e$
                if drl_prm9$ = 1,
                     [
                     spaces$ = 0
                     "#135=#120(STORE 1ST Z PLANE HIT)", e$
                     ]
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     "POPEN", e$
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[X*AXIS*SINGLE*SURFACE*PROBING*]", e$                     
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     sdprint, "[","Z*POSITION*IS*#137[24]*Z*ERROR*IS*#142[24]]", e$
                     sdprint, "[","SIZE*OF*FEATURE*IS*#138[24]*ERROR*IS*#143][24]", e$ 
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     "PCLOS", e$
                     spaces$ = 1
                     ] 
                ]
           if drl_prm3$ <> 0 & drl_prm2$ = 0, #Y Axis Single Surface Probing
                [
                ysinsurf = (yout + drl_prm3$)
                pbld, n$, *strg659810, *ysinsurf,  e$
                pbld, n$, *strg659810, *prorefht, e$
                pbld, n$, *strg659810, *zsinsurf, e$
                pbld, n$, *strg659811, *yout, [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *zsinsurf, e$
                pbld, n$, *strg659810, *ysinsurf, e$
                pbld, n$, *strg659810, *prorefht, e$
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     "POPEN", e$
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[Y*AXIS*SINGLE*SURFACE*PROBING*]", e$                     
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]",e$ 
                     sdprint, "[","Z*POSITION*IS*#137[24]*Z*ERROR*IS*#142[24]*]", e$
                     sdprint, "[","SIZE*OF*FEATURE*IS*#138[24]*ERROR*IS*#143[24]*]", e$ 
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     "PCLOS", e$
                     spaces$ = 1
                     ] 
                ]
           if drl_prm2$ = 0 & drl_prm3$ = 0, #Z Axis Single Surface Probing 
                [
                pbld, n$, *strg659810, *prorefht, e$
                pbld, n$, *strg659810, *prnrefht, e$
                pbld, n$, *strg659811, *zsinsurf, [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *prnrefht, e$
                pbld, n$, *strg659810, *prorefht, e$,    
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     "POPEN", e$
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[Z*AXIS*SINGLE*SURFACE*PROBING*]", e$                     
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$ 
                     sdprint, "[","Z*POSITION*IS*#137[24]*Z*ERROR*IS*#142[24]*]", e$
                     sdprint, "[","SIZE*OF*FEATURE*IS*#138[24]*ERROR*IS*#143[24]*]", e$ 
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     "PCLOS", e$
                     spaces$ = 1
                     ] 
                ]    
           pcom_movea
           ]          
      if drillcyc$ = 9, #Web/Pocket Measure 
           [
           pdrlcommonb
           pbld, n$, *strg659810, *prorefht, e$
           pbld, n$, *strg659810, prnrefht, e$
           pbld, n$, *strg659812,[if drl_prm2$ > 0, *drl_prm2$],[if drl_prm3$, *drl_prm3$],[if dwell$ = zero, *zbossdep],[if dwell$ = 1,[if radclear, *radclear]],
 [if feattol, *feattol],[if offupdate, *offupdate],[if trueposzone, *trueposzone],[if toolupdate, *toolupdate],[if drl_prm10$, *drl_prm10$],e$
           pbld, n$, *strg659810, *prnrefht, e$
           pbld, n$, *strg659810, *prorefht, e$
           if drl_prm10$,
                     [
                     spaces$ = 0
                     "POPEN", e$
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     sdprint, "[","Z*POSITION*IS",*zbossdep,"]", e$
                     sdprint, "[","SIZE*OF*FEATURE*IS*#138[24]*ERROR*IS*#143[24]*]", e$ 
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     "PCLOS", e$
                     spaces$ = 1
                     ]    
           pcom_movea
           ]                
      if drillcyc$ = 10, #Bore/Boss
           [
           pdrlcommonb
           pbld, n$, *strg659810, *prorefht, e$           
           pbld, n$, *strg659810, *prnrefht, e$
           pbld, n$, *strg659814, *diadwell, [if shftdrl$ = zero, *zbossdep], [if radclear, *radclear], [if offupdate > 0,*offupdate],
 [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$
           pbld, n$, *strg659810, *prnrefht, e$
           pbld, n$, *strg659810, *prorefht, e$
           if drl_prm10$,
                     [
                     spaces$ = 0
                     "POPEN", e$
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     #sdprint, "[","Z*POSITION*IS",*zbossdep,"]", e$
                     sdprint, "[","*DIA*#138[24]*ERROR*#143[24]*]", e$ 
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     "PCLOS", e$
                     spaces$ = 1
                     ] 
           pbld, n$, *sg00, *zabs, e$        
           pcom_movea 
           ]            
      if drillcyc$ = 11, #Internal Corner Measure 
           [
           pdrlcommonb
           if icorn <> 0 & jcorn = 0, #Internal Corner Probing Using I 
                [
                if drl_prm1$ = 1, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 2, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 3, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 4, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 0, result = mprint(scornerror), exitpost$
                if drl_prm1$ > 4, result = mprint(scornerror), exitpost$                      
                pbld, n$, *strg659810, *xcorn, *ycorn, e$
                pbld, n$, *strg659810, *prorefht, e$
                pbld, n$, *strg659810, *zcorn, e$
                pbld, n$, *strg659815, *xout, *yout, [if shftdrl$, *icorn], [if corn_angtoler > 0, *corn_angtoler], [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *prorefht, e$
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     "POPEN", e$
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[INTERNAL*CORNER*PROBING*USING*I]", e$                     
                     sdprint, "[ANGLE*OF*X*SURFACE*IS*#139[24]*]", e$                     
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$ 
                     sdprint, "[","Z*POSITION*IS*",*zcorn,"]", e$
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     "PCLOS", e$
                     spaces$ = 1
                     ] 
                ]
           if icorn = 0 & jcorn <> 0, #Internal Corner Probing Using J
                [
                if drl_prm1$ = 1, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 2, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 3, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 4, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 0, result = mprint(scornerror), exitpost$
                if drl_prm1$ > 4, result = mprint(scornerror), exitpost$ 
                pbld, n$, *strg659810, *xcorn, *ycorn, e$
                pbld, n$, *strg659810, *prorefht, e$
                pbld, n$, *strg659810, *zcorn, e$
                pbld, n$, *strg659815, *xout, *yout, [if retr$, *jcorn], [if corn_angtoler > 0, *corn_angtoler], [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *prorefht, e$
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     "POPEN", e$
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[INTERNAL*CORNER*PROBING*USING*J]", e$                                          
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[ANGLE*OF*Y*SURFACE*IIS*#142[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     sdprint, "[","Z*POSITION*IS*",*zcorn,"]", e$ 
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     "PCLOS", e$
                     spaces$ = 1
                     ] 
                ]
           if icorn <> 0 & jcorn <> 0, #Internal Corner Probing Using I and J
                [
                if drl_prm1$ = 1, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 2, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 3, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 4, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 0, result = mprint(scornerror), exitpost$
                if drl_prm1$ > 4, result = mprint(scornerror), exitpost$ 
                pbld, n$, *strg659810, *xcorn, *ycorn, e$
                pbld, n$, *strg659810, *prorefht, e$
                pbld, n$, *strg659810, *zcorn, e$
                pbld, n$, *strg659815, *xout, *yout, [if dwell$, *icorn], [if retr$, *jcorn],  [if corn_angtoler > 0, *corn_angtoler], [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *prorefht, e$
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     "POPEN", e$
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[INTERNAL*CORNER*PROBING*USING*I*AND*J]", e$                     
                     sdprint, "[ANGLE*OF*X*SURFACE*=*#139]", e$                     
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[ANGLE*OF*Y*SURFACE*IS*#142[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     sdprint, "[","Z*POSITION*IS*",*zcorn,"]", e$
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     "PCLOS", e$
                     spaces$ = 1
                     ] 
                ]                
           if icorn = 0 & jcorn = 0, #Internal Corner Probing 90 deg Corner 
                [
                if drl_prm1$ = 1, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 2, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 3, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 4, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 0, result = mprint(scornerror), exitpost$
                if drl_prm1$ > 4, result = mprint(scornerror), exitpost$                
                pbld, n$, *strg659810, *xcorn, *ycorn, e$
                pbld, n$, *sg00, *prorefht, e$
                pbld, n$, *strg659810, *zcorn, e$
                pbld, n$, *strg659815, *xout, *yout, [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *prorefht, e$   
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     "POPEN", e$
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[INTERNAL*CORNER*90*DEG*CORNER*PROBING*]", e$                     
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     sdprint, "[","Z*POSITION*IS*",*zcorn,"]", e$
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     "PCLOS", e$
                     spaces$ = 1
                     ] 
                ]    
           pcom_movea
           ]                
      if drillcyc$ = 12, #External Corner Probing Routine 
           [
           pdrlcommonb
           if icorn <> 0 & jcorn = 0, #Internal Corner Probing Using I 
                [
                if drl_prm1$ = 1, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 2, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 3, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 4, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 0, result = mprint(scornerror), exitpost$
                if drl_prm1$ > 4, result = mprint(scornerror), exitpost$                      
                pbld, n$, *strg659810, *xcorn, *ycorn, e$
                pbld, n$, *strg659810, *prorefht, e$
                pbld, n$, *strg659810, *zcorn, e$
                pbld, n$, *strg659816, *xout, *yout, [if shftdrl$, *icorn], [if corn_angtoler > 0, *corn_angtoler], [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *prorefht, e$
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[EXTERNAL*CORNER*PROBING*USING*I]", e$                     
                     sdprint, "[ANGLE*OF*X*SURFACE*IS*#139[24]*]", e$                     
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     sdprint, "[","Z*POSITION*IS*",*zcorn,"]", e$
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     spaces$ = 1
                     ] 
                ]
           if icorn = 0 & jcorn <> 0, #Internal Corner Probing Using J
                [
                if drl_prm1$ = 1, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 2, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 3, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 4, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 0, result = mprint(scornerror), exitpost$
                if drl_prm1$ > 4, result = mprint(scornerror), exitpost$ 
                pbld, n$, *strg659810, *xcorn, *ycorn, e$
                pbld, n$, *strg659810, *prorefht, e$
                pbld, n$, *strg659810, *zcorn, e$
                pbld, n$, *strg659816, *xout, *yout, [if retr$, *jcorn], [if corn_angtoler > 0, *corn_angtoler], [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *prorefht, e$
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[EXTERNAL*CORNER*PROBING*USING*J]", e$                                        
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[ANGLE*OF*Y*SURFACE*IS*#142[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     sdprint, "[","Z*POSITION*IS*",*zcorn,"]", e$
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     spaces$ = 1
                     ] 
                ]
           if icorn <> 0 & jcorn <> 0, #Internal Corner Probing Using I and J
                [
                if drl_prm1$ = 1, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 2, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 3, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 4, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 0, result = mprint(scornerror), exitpost$
                if drl_prm1$ > 4, result = mprint(scornerror), exitpost$ 
                pbld, n$, *strg659810, *xcorn, *ycorn, e$
                pbld, n$, *strg659810, *prorefht, e$
                pbld, n$, *strg659810, *zcorn, e$
                pbld, n$, *strg659816, *xout, *yout, [if dwell$, *icorn], [if retr$, *jcorn],  [if corn_angtoler > 0, *corn_angtoler], [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *prorefht, e$
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[EXTERNAL*CORNER*PROBING*USING*I*AND*J]", e$                     
                     sdprint, "[ANGLE*OF*X*SURFACE*IS*#139[24]*]", e$                     
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[ANGLE*OF*Y*SURFACE*IS*#142[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     sdprint, "[","Z*POSITION*IS*",*zcorn,"]", e$
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     spaces$ = 1
                     ] 
                ]                
           if icorn = 0 & jcorn = 0, #Internal Corner Probing 90 deg Corner 
                [
                if drl_prm1$ = 1, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 2, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout + ydcorn
                     ]
                if drl_prm1$ = 3, 
                     [                    
                     xcorn = xout - xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 4, 
                     [
                     xcorn = xout + xdcorn
                     ycorn = yout - ydcorn
                     ]
                if drl_prm1$ = 0, result = mprint(scornerror), exitpost$
                if drl_prm1$ > 4, result = mprint(scornerror), exitpost$                
                pbld, n$, *strg659810, *xcorn, *ycorn, e$
                pbld, n$, *strg659810, *prorefht, e$
                pbld, n$, *strg659810, *zcorn, e$
                pbld, n$, *strg659816, *xout, *yout, [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *prorefht, e$   
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[EXTERNAL*CORNER*90*DEG*CORNER*PROBING*]", e$                      
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     sdprint, "[","Z*POSITION*IS*",*zcorn,"]", e$
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     spaces$ = 1
                     ] 
                ]    
           pcom_movea 
           ]               
      if drillcyc$ = 13, #4th Axis X Measure
           [
           pdrlcommonb
           pbld, n$, *strg659810, *prorefht, e$
           pbld, n$, *strg659810, prnrefht, e$
           pbld, n$, "G65P9818", diedwell, pfyout, pfzout, [if offupdate > 0,*offupdate], [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$
           pbld, n$, *strg659810, *prnrefht, e$ 
           pbld, n$, *strg659810, *prorefht, e$            
           pcom_movea
           ]
      if drillcyc$ = 14, #4th Axis Y Measure
           [
           pdrlcommonb
           pbld, n$, *strg659810, *prorefht, e$
           pbld, n$, *strg659810, prnrefht, e$
           pbld, n$, *strg659811, pfyout, pfzout, [if offupdate > 0,*offupdate], [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$
           pbld, n$, *strg659810, *prnrefht, e$
           pbld, n$, *strg659810, *prorefht, e$
           pcom_movea
           ] 
      if drillcyc$ = 15, #Bore/Boss on PCD  
           [
           pdrlcommonb
           pbld, n$, *strg659810, *prorefht, e$           
           pbld, n$, *strg659810, *prnrefht, e$
           pbld, n$, *strg659819, *pcddia, *diadwell, [if shftdrl$ = zero, *zbossdep], [if shftdrl$ = one, *zpcddep], [if radclear, *radclear],
 [if trueposzone > 0, *trueposzone], [ if apcdang, *apcdang], [if drl_prm10$ > 0, *drl_prm10$], e$
           pbld, n$, *strg659810, *prnrefht, e$
           pbld, n$, *strg659810, *prorefht, e$
           if drl_prm10$,
                     [
                     spaces$ = 0
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     #sdprint, "[","Z*POSITION*IS",*zbossdep,"]", e$
                     sdprint, "[","*DIA*#138[24]*ERROR*#143[24]*]", e$ 
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     spaces$ = 1
                     ]         
           pcom_movea 
           ]                
      if drillcyc$ = 16, #Bore/Boss 
           [
           pdrlcommonb
           pbld, n$, *strg659810, *prorefht, e$
           pbld, n$, *strg659810, *prnrefht, e$
           pbld, n$, *strg659814, *diedwell, pxout, pyout, pzout, [if offupdate > 0,*offupdate], [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$
           pbld, n$, *strg659810, *prnrefht, e$
           pbld, n$, *strg659810, *prorefht, e$
           pcom_movea 
           ]               
      if drillcyc$ = 17, #C Axis Measure 
           [
           pdrlcommonb
           pbld, n$, *strg659810, *prorefht, e$
           pbld, n$, *strg659810, prnrefht, e$
           pbld, n$, *strg659618, cyspan, pfxout, pfzout, [if offupdate > 0,*offupdate], [if cangtoler > 0, *cangtoler], [if drl_prm2$ > 0, *drl_prm2$], [if drl_prm10$ > 0, *drl_prm10$], e$
           pbld, n$, *strg659810, *prnrefht, e$    
           *sg00 ,*sg91, sg28, "Z0", e$     
           *sg00, *sg90, [if workofs$ > 53, *g_wcs], [if workofs$ < 49 , "G54.1", *p_wcs],"C20.",e$
           spaces$ = 0
           sif,sbracketopen,spound,sm152,sgt,drl_prm1$,sbracketclose,sgoto,"1000", e$ 
           spaces$ = 1    
           pcom_movea
           ]                
      if drillcyc$ = 18, #Bore/Boss on PCD 
           [
           pdrlcommonb
           pbld, n$, *strg659810, prnrefht, e$
           pbld, n$, *strg659819, diedwell, pfyout, pfzout, [if offupdate > 0,*offupdate], [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$
           pbld, n$, *strg659810, *prnrefht, e$
           pcom_movea 
           ]               
      if drillcyc$ = 19,
           [
           pdrlcommonb
           pbld, n$, *strg659810, prnrefht, e$
           pbld, n$, "G65P9818", diedwell, pfyout, pfzout, [if offupdate > 0,*offupdate], [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$
           pbld, n$, *strg659810, *prnrefht, e$             
           pcom_movea
           ] 
pdrlcst_2$       #Custom drill cycles 8 - 19 (user option)
      #Use this postblock to customize drilling cycles 8 - 19
      if drillcyc$ = 8,
           [
           pdrlcommonb
           if drl_prm2$ <> 0 & drl_prm3$ = 0, #X Axis Single Surface Probing
                [
                xsinsurf = (xout + drl_prm2$)
                pbld, n$, *strg659810, *xsinsurf, *yout, e$
                pbld, n$, *strg659810, *prorefht, e$
                pbld, n$, *strg659810, *zsinsurf, e$
                pbld, n$, *strg659811, *xout, [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *zsinsurf, e$
                pbld, n$, *strg659810, *xsinsurf, e$
                pbld, n$, *strg659810, *prorefht, e$
                if drl_prm9$ = 1,
                     [
                     spaces$ = 0
                     "#135=#12X(STORE 1ST Z PLANE HIT)", e$
                     ]
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[X*AXIS*SINGLE*SURFACE*PROBING*]", e$                     
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     sdprint, "[","Z*POSITION*IS*#137[24]*Z*ERROR*IS*#142[24]*]", e$
                     sdprint, "[","SIZE*OF*FEATURE*IS*#138[24]*ERROR*IS*#143[24]*]", e$ 
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     spaces$ = 1
                     ] 
                ]
           if drl_prm3$ <> 0 & drl_prm2$ = 0, #Y Axis Single Surface Probing
                [
                ysinsurf = (yout + drl_prm3$)
                pbld, n$, *strg659810, *ysinsurf, *xout, e$
                pbld, n$, *strg659810, *prorefht, e$
                pbld, n$, *strg659810, *zsinsurf, e$
                pbld, n$, *strg659811, *yout, [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *zsinsurf, e$
                pbld, n$, *strg659810, *ysinsurf, e$
                pbld, n$, *strg659810, *prorefht, e$
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[Y*AXIS*SINGLE*SURFACE*PROBING*]", e$
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     sdprint, "[","Z*POSITION*IS*#137[24]*Z*ERROR*IS*#142[24]*]", e$
                     sdprint, "[","SIZE*OF*FEATURE*IS*#138[24]*ERROR*IS*#143[24]*]", e$ 
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     spaces$ = 1
                     ] 
                ]
           if drl_prm2$ = 0 & drl_prm3$ = 0, #Z Axis Single Surface Probing 
                [
                pbld, n$, *strg659810, *xout, *yout, e$
                pbld, n$, *strg659810, *prorefht, e$
                pbld, n$, *strg659810, *prnrefht, e$
                pbld, n$, *strg659811, *zsinsurf, [if offupdate > 0,*offupdate], [if feattol, *feattol],
 [if trueposzone > 0, *trueposzone], [if toolupdate > 0, *toolupdate], [if drl_prm10$ > 0, *drl_prm10$], e$
                pbld, n$, *strg659810, *prnrefht, e$
                pbld, n$, *strg659810, *prorefht, e$,     
                if drl_prm10$,                
                     [
                     spaces$ = 0
                     sdprint, "[", sopcomment, "]", e$
                     sdprint, "[Z*AXIS*SINGLE*SURFACE*PROBING*]", e$                     
                     sdprint, "[","*X*#135[24]*ERROR*#140[24]*]", e$
                     sdprint, "[","*Y*#136[24]*ERROR*#141[24]*]", e$
                     sdprint, "[","Z*POSITION*IS*#137[24]*Z*ERROR*IS*#142[24]*]", e$
                     sdprint, "[","SIZE*OF*FEATURE*IS*#138[24]*ERROR*IS*#143[24]*]", e$ 
                     sdprint, "[","*TRUE*POSITION*ERROR*#145[24]*]", e$
                     sdprint, "[","-------------------------------------------","]", e$
                     spaces$ = 1
                     ]
                ] 
           pcom_movea
           ]
      if drillcyc$ = 9, 
           [
           pdrlcommonb
           result = mprint(sperror), exitpost$
           pcom_movea
           ]                
      if drillcyc$ = 10,
           [
           pdrlcommonb
           result = mprint(sperror), exitpost$
           pcom_movea 
           ]               
      if drillcyc$ = 11,
           [
           pdrlcommonb
           result = mprint(sperror), exitpost$
           pcom_movea
           ]                
      if drillcyc$ = 12,
           [
           pdrlcommonb
           result = mprint(sperror), exitpost$
           pcom_movea 
                ]               
      if drillcyc$ = 13,
           [
           pdrlcommonb
           pbld, n$, `strg659810, `prnrefht, e$
           pbld, n$, "G65P9818", diedwell, pfyout, pfzout, [if trueposzone > 0, *trueposzone], e$
           pbld, n$, *strg659810, *prnrefht, e$             
           pcom_movea
           ] 
      if drillcyc$ = 14,
           [
           pdrlcommonb
           pbld, n$, `strg659810, `prnrefht, e$
           pbld, n$, *strg659811, pfyout, pfzout, [if trueposzone > 0, *trueposzone], e$
           pbld, n$, *strg659810, *prnrefht, e$               
           pcom_movea
           ]
      if drillcyc$ = 15, #Web/Pocket Measure 
           [
           pdrlcommonb
           pbld, n$, `strg659810, `prnrefht, e$
           pbld, n$, *strg659812, diedwell, pfyout, pfzout, [if trueposzone > 0, *trueposzone], e$
           pbld, n$, *strg659810, *prnrefht, e$
           pcom_movea
           ]                
      if drillcyc$ = 16, #Bore/Boss 
           [
           pdrlcommonb
           pbld, n$, `strg659810, `prnrefht, e$
           #pbld, n$, *strg659814, diedwell, pfyout, pfzout, [if trueposzone > 0, *trueposzone], e$
           pbld, n$, *strg659810, *prnrefht, e$
           pcom_movea 
           ]               
      if drillcyc$ = 17,
           [
           pdrlcommonb
           pbld, n$, `strg659810, `prnrefht, e$
           pbld, n$, "G65P9818", diedwell, pfyout, pfzout, [if trueposzone > 0, *trueposzone], e$
           pbld, n$, *strg659810, *prnrefht, e$
           pcom_movea
           ]                
      if drillcyc$ = 18,
           [
           pdrlcommonb
           pbld, n$, `strg659810, `prnrefht, e$
           pbld, n$, "G65P9818", diedwell, pfyout, pfzout, [if trueposzone > 0, *trueposzone], e$
           pbld, n$, *strg659810, *prnrefht, e$
           pcom_movea 
                ]               
      if drillcyc$ = 19,
           [
           pdrlcommonb
           pbld, n$, *strg659810, *prorefht, e$
           pbld, n$, `strg659810, `prnrefht, e$
           pbld, n$, "G65P9818", diedwell, pfyout, pfzout, [if trueposzone > 0, *trueposzone], e$
           pbld, n$, *strg659810, *prnrefht, e$ 
           pbld, n$, *strg659810, *prorefht, e$            
           pcom_movea
           ] 

pcanceldc$       #Cancel canned drill cycle
      result = newfs(three, zinc)
      z$ = initht$
      prv_zia = initht$
      pxyzcout
      !zabs, !zinc
      prv_gcode$ = zero
      pcan
      pcan1, pbld, n$, sg80, strcantext, e$
      if drillcyc$ = 7, pbld, n$, sg94, e$
      pcan2

HTH

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