Hello, I have an easy one for the experts. I’m looking to add a goto command (I think). I want to ask the question at the beginning of the program “does this part have the 8mm hole?” If answered “yes” it will run the program as normal. If no it will skip that block where it measures that hole. Could someone help me with the code?
Flow control commands
Collapse
X
-
You just have to add a label at the end of the block that you want to skip. Be carefull about move to clear plane or clear point.
Then, after the comment, insert
IF/ C1.INPUT=="NO"
GOTO L1
END IF
You could also decrease the speed before the hole measurement, in case of the operator gave the bad answer!
- Likes 2
-
YES or NO Comment. IF/ END_IF. Like Jeffery said make sure you have some clearance move or something before and/or after so it can continue through the program, no real need for a GOTO command.
Code:[COLOR=#3498DB]C1 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO, Is 8 MM Hole There?[/COLOR] [COLOR=#C0392B]IF/C1.INPUT=="YES"[/COLOR] 8MM_HOLE =FEAT/CONTACT/CIRCLE/ADAPTIVE_CIRCLE_SCAN,CARTESIAN,IN,LEAST_SQR THEO/<-1.162,-4.375,-0.145>,<0,0,1>,0.141 ACTL/<-1.1639,-4.3684,-0.145>,<0,0,1>,0.1408 TARG/<-1.162,-4.375,-0.145>,<0,0,1> START ANG=0,END ANG=360 ANGLE VEC=<1,0,0> DIRECTION=CCW SHOW FEATURE PARAMETERS=NO SHOW CONTACT PARAMETERS=NO [COLOR=#C0392B]END_IF/[/COLOR]
(In Memory of my Loving wife, "Ronda" who I lost March 7, 2016. I love you baby.)They say "Nobody's Perfect." I must be Nobody.
- Likes 3
Comment
-
Never mind I got it. Thanks for the idea!
-
Jay_Q I dont remember which programs I have that use it but what I do is:
C1 =YESNO (comment parameters here)
Does part have tooling tabs attached?
Assign/OPTOGGLE="NONE"
IF/C1.INPUT=="NO"
ASSIGN/OPTOGGLE=="BOTH"
END_IF/
Ask operator if tabs are attached. The first assignment sets OPTOGGLE to "NONE". If the operator selects "NO" then the program will run the IF/END_IF comment assigning OPTOGGLE to "BOTH". All you need to do is set the output on the dimensions you want to toggle on and off to OPTOGGLE. Easiest way to do that is put the cursor somewhere in "OUTPUT" then hit tab and that will highlight "BOTH", then just type OPTOGGLE.
-
Or get real guru like and have the CMM attempt to take a point at the center of the hole. If the point is taken then skip to the next feature. If the point is not taken because there's a hole, then use an ON ERROR command to go to the Auto Circle. This takes the operator completely out of it and probably save a few styli and maybe a TP 20. Even the best of us have been known to hit the wrong key.
- Likes 4
Comment
-
Kingsld1, what if it was a small hole (.080”) that you are checking w/ a .040” probe that had potential to be off location .100” in either direction? So one center target point wouldn’t work. I currently use find hole (center). But if the hole wasn’t there can you still use a ON ERROR command with find hole to take the operator out of it? So if it doesn’t find the hole instead of asking to read the position it will just skip it?
-
This complicates things considerably.
Yes you can use ON ERROR with Auto Circles. The default would be to skip it which is probably not what you want. In Theory, some really complicated code could be written to attempt measuring the hole in several places but it would be really messy to write and maintain. Is there a feature that you could use the "relative to" option in the Auto Circle dialog to give you a better shot at hitting the hole? Something relatively large that the probe hits every time that is put in at the same time as the small hole?
Comment
-
That small hole is put in on a 1/4 tab it’s just for a safety wire or something it has no location on the print just a minimum wall thickness on that tab. The machinist just eyeball it and drill it by hand. And it’s not always in the part when we first check it because the can put it in at anytime. I do pick up that tab with a point on the face and on the side for relative measure but I haven’t had a chance to try it . My thoughts was find hole, but then on this thread talking about being able to make it fully automated without human error sounded nice.
-
Related Topics
Collapse
-
by grandpaal56I am not very experienced in usung flow commands. Attached is a portion of the code with the "IF_GOTO" commands I am trying to use. I'm having...
-
Channel: PC-DMIS for CMMs
02-21-2011, 09:41 AM -
-
by ErikirI have one program that inspects two slightly different parts. Part 1 has an 8mm hole, part 2 does not.
The operator is prompted to choose...-
Channel: PC-DMIS for CMMs
03-18-2015, 02:24 PM -
-
by EnteyHello, I'm trying to make program for 4 different parts, the only difference in parts are hole positions. I would like to make it so you can select part...
-
Channel: PC-DMIS for CMMs
11-14-2017, 12:38 PM -
-
by kingsld1PC DMIS 2011 MR1 Windows 7 Pro 64 bit
Two issues
Goto command doesn't work on new programs anymore.
My programs...-
Channel: PC-DMIS for CMMs
12-18-2012, 03:03 PM -
-
by cdugan136Hey everyone I could really use some help from all of you advanced programmers out there. I have a 50 piece order of some pretty complex frames from my...
-
Channel: PC-DMIS for CMMs
04-15-2016, 09:37 AM -
Comment