I've just recently started adding some of PCDMIS's Flow commands to our programs to give them more versatility and power. So forgive me as I'm new to this. So, as of late I have modifying programs to measure parts that are in different stages of manufacture using Case commands to measure features that are only inherit to the part at that stage of manufacture. For example, if op 1 is complete, there is an option in the input comment reflecting that. Same as op's 2 thru whatever. Now, the issue is that those case blocks will only perform tasks associated with that operation. And that is what I want. However, I'm trying to add an option that says "ignore the individual operation cases and measure the whole part as it is complete." this would be the case if inspectors are doing final inspections on completed parts and not individual operations checks. How would any of you best approach this? The case options detailed in the input comment only execute their individual case blocks ad then exit. I guess I'm asking for something that says, "hey, the part's complete, just ignore the following case commands and go to town." Thanks....just trying to get more efficient.
Programming techniques
Collapse
X
-
A couple of simple If/goto statements. Add an input comment at the beginning of the program where the operator type in 5 for full inspection. Add a label at the beginning of each of your case, ie. Case1, Case2, etc. Then at the end of your case 1, add in a IF c1.input == "5", goto case2. At the end of your case2, add If c1.input == "5" goto case 3. And so on.
-
I like to use a for with several radio buttons for each operation.
For one particular part there are 12 stations in the machine and we need to check them at all the various stages.
The 1st button is the complete part it's value equal 12.
Using combinations of:
IF/GOTO
IF/END_IF
IF radio button==12 (nothing happens and entire program runs)
IF radio button<=11/ goto label
etc, etc.
Comment
-
I tend to utilize Forms for flow control. Depending on their selection, I use IF/THEN statements with GOTO labels. Be careful if you do that. You want to make sure your alignments are correct. There are some flow controls I use that skip over some alignment features, so I need to recall previous alignments in order for the CMM to not crash.
- 1 like
Comment
-
Good call on the alignments. If you're skipping around the program, it's a good practice to recall or make a new alignment. You'll also want to redefine your parameters. Especially your probe and probe angle, prehit/retract, touchspeed, etc. PCDMIS likes to roll with whatever parameters was last in the code even if you skipped over that portion.
Comment
-
Originally posted by Ravenmaniac View PostI guess I'm asking for something that says, "hey, the part's complete, just ignore the following case commands and go to town." Thanks....just trying to get more efficient.
bfire85 makes an excellent point: you can get into serious trouble skipping or nor skipping alignments in a flexible program. This flexibale-program technique really only makes sense if the master alignment is common across all stages of manufacture.
Also kingsld1 suggestion of using OR is spot-on, that should work elegantly for making sure each modular section gets run for a final inspection.
Comment
-
kingsld1 mentioned both things I was thinking of, but note that if you have used the SELECT CASE construct
Code:SELECT/OP_NO CASE/1 … END_CASE CASE/2 … END_CASE CASE/3 … END_CASE END_SELECT
there is no [simple, recommendable] way to execute all cases in sequence. You need the following IF structure to be able to do that
Code:IF/(OP_NO == 1) or (ALL_OPS == TRUE) … ENDIF IF/(OP_NO == 2) or (ALL_OPS == TRUE) … ENDIF IF/(OP_NO == 3) or (ALL_OPS == TRUE) … ENDIF
But mainly you should look into mini routines, and possibly the FBM (Feature Based Measurement) option.AndersI
SW support - Hexagon Metrology Nordic AB
Comment
-
Thanks Everyone! I will experiment around with the If statements. Also to examine the proper sequencing and structure of using them. I have noted that keeping the alignment sequences pristine is critical when surfing around the program using cases. I always try to "leave a case subroutine the same way you found it when you entered." Helps keep the program from locking up. Again, thanks everyone!Physics dictates to man why his world acts the way it does....Chemistry tells him why it smells the way it does.
Comment
-
Marked sets is what I would use. They work well and are easy to set up. No coding needed.
I like marked sets for when you have to do a 100% sort for a dimension that is out of tolerance. You can create it to measure only what is needed to get the results you want. This also saves valuable CMM time VS running the full program for 1 or 2 dimensions.Last edited by William Johnson; 02-14-2019, 07:47 AM.Time for the Trolls to leave.
- 2 likes
Comment
-
So we are running into the same thing here except with tooling tabs. We have separate programs for side 1, 2 and tooling tab areas. I combined side 1 and tooling tab areas and used YES/NO comments with the IF_END to navigate the program. We run side 1, analyze, then save the program under that job number and date. When the part comes back in, we use the YES/NO comments to just run the tooling tab areas. I align the part then equate that alignment to the original side 1 alignment so we get one report for side 1 without tooling tabs. I could do it without equating but we have to have the CAD in the report and don't want one set of points out in space.
My next step is to incorporate both sides and the tooling tab areas in one program, and thus, one report instead of instead of sending 3 reports to the customer.
Code is in the next post with my personal notes in ().
I can run this program in three different ways. Side one with tooling tabs attached, side one tooling tab areas only, and side one complete without tooling tabs attached. Program would mostly be run the first two ways, I just threw the complete part without tooling tabs option in because I could.
"Do what I want you to do, not what I tell you to do."
-Me
Comment
-
flow control example for tooling tabsCode:format/text,options, ,headings,symbols, ;nom,tol,meas,maxmin,dev,outtol, loadprobe/1point5mm80 tip/t1a0b0, shankijk=0, 0, 1, angle=0 c1 =comment/yesno,no,full screen=no,auto-continue=no, (question asks if the part is complete with out tabs or not) is this a complete part with tooling tabs removed? If/c1.input=="yes" (if comment c1 is answered "no" this comment will be skipped and tab areas will not be ran) c2 =comment/yesno,no,full screen=no,auto-continue=no, (questions operator if they want to run the whole part with the tab areas or run the tab areas only) do you want to run the tooling tab areas only? "yes" will run the tooling tab areas only. "no" will run the entire program. If_goto/c2.input=="yes",goto = l2 (if running tabareas only, this will send you to the beginning of the second manual alignment) end_if/ (body of program) dim loc2= location of cylinder cyl1 units=in ,$ (last dimension in body of program before tooling tab areas) graph=off text=off mult=10.00 output=both half angle=no ax nominal +tol -tol meas max min dev outtol x 0.5011 0.0050 0.0050 0.5011 0.9656 0.0366 0.0000 0.0000 ----#---- y 12.5500 0.0050 0.0050 12.5500 12.9523 12.1477 0.0000 0.0000 ----#---- d 0.9290 0.0050 0.0050 0.9290 0.9290 0.9290 0.0000 0.0000 ----#---- end of dimension loc2 if_goto/c1.input=="no",goto = end (if tooling tabs are present, goto the end of the program before tab area dimensions) move/clearplane pnt1171 =feat/contact/vector point/default,cartesian (first point on tooling tab areas when rinning the entire part w/tooling tabs removed) theo/<6.1288,46.31,-0.0711>,<0,1,0> actl/<6.1288,46.31,-0.0711>,<0,1,0> targ/<6.1288,46.31,-0.0711>,<0,1,0> snap=no show feature parameters=no show contact parameters=no pnt1345 =feat/contact/vector point/default,cartesian (last point on tooling tab areas when rinning the entire part w/tooling tabs removed) theo/<-1.2252,0.3366,-0.0449>,<0.4216606,-0.0284342,0.9063078> actl/<-1.2252,0.3366,-0.0449>,<0.4216606,-0.0284342,0.9063078> targ/<-1.2252,0.3366,-0.0449>,<0.4216606,-0.0284342,0.9063078> snap=no show feature parameters=no show contact parameters=no move/clearplane tip/t1a0b0, shankijk=0.0011, -0.001, 1, angle=-0.3476 move/increment,<0,0,9> if_goto/c2.input=="no",goto = end (if running entire part, not tooling tab areas by themselves, this comment sends you to the dimensioning) l2 =label/ (if running tab areas only, answering "yes" to question c2 will send you here) recall/alignment,internal,startup (recall startup alignment for running tooling tabs only) mode/manual (manual mode for taking manual alignment) pnt1-a =feat/contact/vector point/default,cartesian (first point on second manual alignment when running only tooling tab areas) theo/<-8.5119,5.8974,0>,<0,0,1> actl/<-8.5119,5.8974,0>,<0,0,1> targ/<-8.5119,5.8974,0>,<0,0,1> show feature parameters=no show contact parameters=yes avoidance move=no,distance=0.25 show hits=no man_aln_2 =alignment/start,recall:startup,list=yes (second manual alignment) alignment/iterate pnt target rad=0.005,start label=,fixture tol=0,error label= meas all feat=once,level axis=zaxis,rotate axis=xaxis,origin axis=yaxis level=pnt1-a,pnt2-a,pnt3-a,, rotate=pnt4-a,pnt5-a,, origin=pnt6-a,, alignment/end mode/dcc (mode dcc for remainder of part) clearp/zplus,3,zplus,0,off move/clearplane pnt-a3-a =feat/contact/vector point/default,cartesian (first dcc alignment point) theo/<2.1556,6.45,0>,<0,0,1> actl/<2.1556,6.45,0>,<0,0,1> targ/<2.1556,6.45,0>,<0,0,1> snap=no show feature parameters=no show contact parameters=yes avoidance move=no,distance=0.25 show hits=no dcc_aln_2 =alignment/start,recall:man_aln_2,list=yes (second dcc alignment) alignment/iterate pnt target rad=0.005,start label=,fixture tol=0,error label= meas all feat=always,max iterations=99,level axis=zaxis,rotate axis=xaxis,origin axis=yaxis level=pnt-a3-a,pnt-a2-a,pnt-a1-a,, rotate=pnt-b1-a,pnt-b-a,, origin=pnt-ref-c-a,, alignment/end equate/dcc_aln_2, to alignment, dcc_aln (equate alignment. Doing this will allow you to run the part with tooling tabs then running the tooling tab areas later and have one report with all points and features where they need to be on the report cad) move/clearplane pnt1346 =feat/contact/vector point/default,cartesian (first point on tab areas if only running tab areas with the equate alignment) theo/<6.1288,46.31,-0.0711>,<0,1,0> actl/<6.1288,46.31,-0.0711>,<0,1,0> targ/<6.1288,46.31,-0.0711>,<0,1,0> snap=no show feature parameters=no show contact parameters=no pnt1393 =feat/contact/vector point/default,cartesian (last point on tab areas if only running tab areas with the equate alignment) theo/<-1.2252,0.3366,-0.0449>,<0.4216606,-0.0284342,0.9063078> actl/<-1.2252,0.3366,-0.0449>,<0.4216606,-0.0284342,0.9063078> targ/<-1.2252,0.3366,-0.0449>,<0.4216606,-0.0284342,0.9063078> snap=no show feature parameters=no show contact parameters=no move/clearplane tip/t1a0b0, shankijk=0.0011, -0.001, 1, angle=-0.3476 end =label/ (end of program label. If running entire part, the goto comment before the second manual alignment will send you here) move/increment,<0,0,9> scn73 =feat/set,cartesian (scan set of tab area points when running the entire part) theo/<-2.4715,19.2468,-0.0978>,<0,0,1> actl/<-2.4715,19.2468,-0.0978>,<0,0,1> constr/set,basic,pnt1171,pnt1172,pnt1173,pnt1174,pnt1175,pnt1176,pnt1177,pnt1244,pnt1245,pnt1246,pnt1247,pnt1248,pnt1249, pnt1285,pnt1286,pnt1287,pnt1288,pnt1289,pnt1290,pnt1291,pnt1292,pnt1333,pnt1334,pnt1335,pnt1336,pnt1337,pnt1338 scn77 =feat/set,cartesian (scan set of tab area points when running only the tab areas) theo/<-2.4715,19.2468,-0.0978>,<0,0,1> actl/<-2.4715,19.2468,-0.0978>,<0,0,1> constr/set,basic,pnt1346,pnt1347,pnt1348,pnt1349,pnt1350,pnt1351,pnt1352,pnt1353,pnt1354,pnt1355,pnt1356,pnt1357,pnt1358, pnt1373,pnt1374,pnt1375,pnt1376,pnt1377,pnt1378,pnt1379,pnt1380,pnt1381,pnt1382,pnt1383,pnt1384,pnt1385,pnt1386 (the if/end_if comments set the output of the dimensioning of the tab areas. These will change based upon how you state your comment/questions at the begining of the program) if/c2.input=="yes" (if c2 is answered "yes" then dimension below with "output=optoggle2" will be set to "report") assign/optoggle2="report" end_if/ if/c2.input=="no" (if c2 is answered "no" then dimension below with "output=optoggle2" will be set to "none") assign/optoggle2="none" end_if/ if/c2.input=="no" (if c2 is answered "no" then dimension below with "output=optoggle" will be set to "report") assign/optoggle="report" end_if/ if/c2.input=="yes" (if c2 is answered "yes" then dimension below with "output=optoggle" will be set to "none") assign/optoggle="none" end_if/ if/c1.input=="no" (if c1 is answered "no" then dimension below with "output=optoggle" will be set to "none") assign/optoggle="none" end_if/ if/c1.input=="no" (if c1 is answered "no" then dimension below with "output=optoggle2" will be set to "none") assign/optoggle2="none" end_if/ dim 141a= profile of surface of set scn73 formandlocation units=in ,$ (profile of tab areas scan set when running the entire part) graph=off text=off mult=10.00 arrowdensity=100 output=optoggle ax nominal +tol -tol meas max min dev outtol m 0.0000 0.0300 0.0300 0.0000 0.0000 0.0000 0.0000 0.0000 ----|---- dim 141b= profile of surface of set scn77 formandlocation units=in ,$ (profile of tab areas scan set when running the tab areas only) graph=off text=off mult=10.00 arrowdensity=100 output=optoggle2 ax nominal +tol -tol meas max min dev outtol m 0.0000 0.0300 0.0300 0.0000 0.0000 0.0000 0.0000 0.0000 ----|----
Last edited by A-machine-insp; 02-14-2019, 08:54 AM."Do what I want you to do, not what I tell you to do."
-Me
Comment
-
An update on the code example I posted above. I cut out the part where I can run the complete part without tooling tabs attached since we will surely never have a first part run the whole program at one time. We will always get it with tooling tabs then see the same part again with them removed.
Deleting that part of the program cleans the CAD points up since we have to submit reports to the customer with the CAD included. If I didn't delete that part, I would have points out in space and the actual CAD model would be smaller on the report due to DMIS fitting everything into the window."Do what I want you to do, not what I tell you to do."
-Me
Comment
Related Topics
Collapse
-
by norvilleI have to measure a huge family of parts wich have exactly same shape, but are scaled. Has anyone a good idea other than using tons of variables and ...
-
Channel: PC-DMIS for CMMs
10-08-2012, 04:11 PM -
-
by ErikirI figured out how to do it if the inputs are numbers (if comment1 <1 and >4 goto label)
I could do something along the lines of "type...-
Channel: PC-DMIS for CMMs
10-08-2013, 02:42 PM -
-
by AndersIOK, I'm stumped (not really, but I would like a general solution).
If I have an IF_GOTO/C1.INPUT == "YES" in my program, it will...-
Channel: Tips & Tricks
05-27-2014, 10:31 AM -
-
Hello:
I'm trying to write some code for the first time that will allow me to run multiple parts from the same program. Each has a different...-
Channel: PC-DMIS for CMMs
01-19-2015, 02:46 PM -
-
by qcfire65Ok, I'm kind of at the basic of using these. What I am trying to do is create a statement (there are two actual statements) but if it is the first statement...
-
Channel: PC-DMIS for CMMs
11-12-2015, 10:26 AM -
Comment