Probing

Started by Jimbo17, December 07, 2023, 07:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jimbo17

I'm probing nested parts. Is there a way to get my ( IF ) statement to out put. Instead of manually editing the G-code. example below.

(DRILL 1.008 +.005/-.000 PIN HOLE AT B270-11)
M130
T46 T36 M06 (1.011 KSEM CARBIDE INSERT DRILL)
M699 T45
G00 G17 G90 G54.1 P71
B270.
M131 K1000
X-1. Y1. S1116 M03
G43 H46 Z15.
G94
IF[#821 EQ 0] GOTO 201
G00 Z1.
G98 G81 Z-2.659 R.1 F11.
G80
(DRILL 1.008 +.005/-.000 PIN HOLE AT B270-13)
N201
IF[#823 EQ 0] GOTO 202
G54.1 P73 X-1. Y1. Z1.
G98 G81 Z-2.659 R.1 F11.
G80
(DRILL 1.008 +.005/-.000 PIN HOLE AT B270-15)
N202
IF[#825 EQ 0] GOTO 203
G54.1 P75 X-1. Y1. Z1.
G98 G81 Z-2.659 R.1 F11.
G80

JParis

How are you generating your probing cycles? Productivity+ ?

Jimbo17

 By hand. ( manual edits )

JParis

Assuming you are using a Fanuc based post...

You'll need to define your variables

macro_var     : 801  #Starting variable number
skip_value    : 201  #Your landing value
sav_macro_var : 0    #sav macro variable
sav_skip_value : 0   #save skip value

in the psof$ section under the G43 line

"IF", "[#", no_spc$, macro_var, no_spc$, "EQ0]GOTO", no_spc$, skip_value, e$

at the end of posf$
sav_macro_var = macro_var
sav_skip_value = skip_value

Then in the ptlchg0$ section under the z output line

macro_val = sav_macro_value + 1
skip_value = sav_skip_value + 1
"IF", "[#", no_spc$, macro_var, no_spc$, "EQ0]GOTO", no_spc$, skip_value, e$

You'll also need to add to the ptlchg$ section

Then at the end of the tool, you can either reset your values or preset them for the next tool if they will be different.

This all off the cuff, so some tweaking will likely be necessary
Like Like x 3 View List

CNCAppsJames

Quote from: JParis on December 07, 2023, 09:35 AMAssuming you are using a Fanuc based post...

You'll need to define your variables

macro_var    : 801  #Starting variable number
skip_value    : 201  #Your landing value
sav_macro_var : 0    #sav macro variable
sav_skip_value : 0  #save skip value

in the psof$ section under the G43 line

"IF", "[#", no_spc$, macro_var, no_spc$, "EQ0]GOTO", no_spc$, skip_value, e$

at the end of posf$
sav_macro_var = macro_var
sav_skip_value = skip_value

Then in the ptlchg0$ section under the z output line

macro_val = sav_macro_value + 1
skip_value = sav_skip_value + 1
"IF", "[#", no_spc$, macro_var, no_spc$, "EQ0]GOTO", no_spc$, skip_value, e$

You'll also need to add to the ptlchg$ section

Then at the end of the tool, you can either reset your values or preset them for the next tool if they will be different.

This all off the cuff, so some tweaking will likely be necessary
I'd make two small change.... if this is going to be used only for probing, I would add it to the pmisc1$ (assuming you use that cycle for probing), then cancel at the canned cycle cancel post block.

JM2CFWIW

"We have run out of money. I guess we'll have to think." Ernest Rutherford

Autodesk Inventor Pro CAD 2025
CAMplete TruePath 2025 for Posting and Collision Checks
Fusion360 and Mastercam 2025