PDA

View Full Version : Yes No Input comments


Bill McCafferty
01-21-2008, 11:27 AM
Is it possible to use a YES/NO comment to branch around a portion of a program? I don't want to have to do any gymnastics to get this done. I have a program that runs sub assemblies and one of these subs sometimes has a bracket on it that I want to skip the measurements on IF it isn't there.

I'm thinking something like

IF C1.INPUT = "NO" then goto XXXXX

I keep getting an "invalid number entered" error.

Thanks,

Bill

Matthew D. Hoedeman
01-21-2008, 11:28 AM
Why not use something like, 1=YES and 2=NO in the message box, then branch using the 1 or 2 value?

Jan d.
01-21-2008, 11:37 AM
yes, you can jump EXCEPT for jumping over alignments. They always seem to be executed, regardless if you try to jump over them.

I figured a way around that too, but it is convoluted, at best.


Jan.

Bill McCafferty
01-21-2008, 11:46 AM
I got it thanks. It was simple syntax on my part.

IF/C1.INPUT=="YES" <----<<< proper syntax

END/IF <----<<< put this where you want the program to pick up and start running again.

If C1 = "NO" then it continues to run as if the conditional statement wasn't there.

Matt, I wanted to see if I could use YES/NO and it works quite well. I don't want people to have to think about these programs. I want them to be so easy that anyones monkey can run it without having to slow down and think lets see 1 = yes so that means I need a no and thats a 2.. etc...


Bill

Matthew D. Hoedeman
01-21-2008, 11:48 AM
I got it thanks. It was simple syntax on my part.

IF/C1.INPUT=="YES" <----<<< proper syntax

END/IF <----<<< put this where you want the program to pick up and start running again.

If C1 = "NO" then it continues to run as if the conditional statement wasn't there.

Matt, I wanted to see if I could use YES/NO and it works quite well. I don't want people to have to think about these programs. I want them to be so easy that anyones monkey can run it without having to slow down and think lets see 1 = yes so that means I need a no and thats a 2.. etc...

Bill

BUT, you will now require them to be able to SPELL!

Bill McCafferty
01-21-2008, 11:54 AM
Nope no spelling either.. The YES/NO comment starts with YES NO and CANCEL buttons and it's a clicker ONLY; no typing at all. Thats why I wanted to use this one.

Bill

Matthew D. Hoedeman
01-21-2008, 12:02 PM
Nope no spelling either.. The YES/NO comment starts with YES NO and CANCEL buttons and it's a clicker ONLY; no typing at all. Thats why I wanted to use this one.

Bill

OK, you will require them to be able to READ then.

craiger_ny
01-21-2008, 12:10 PM
You need a label to goto, you have a label right?

Bill McCafferty
01-21-2008, 12:11 PM
And ENGLISH at that!!!!!

;) :) ;)

Bill

Bill McCafferty
01-21-2008, 12:13 PM
Thats whats cool about this Craig. You don't even need a lable. If the condition is false, it goes directly to the END/IF and continues from there. If its ture it runs the code that you would skip if false. It took exactly 3 lines to make this work, the comment, the condition, and the end/if.

Bill

John Kugler
01-21-2008, 01:25 PM
Thats whats cool about this Craig. You don't even need a lable. If the condition is false, it goes directly to the END/IF and continues from there. If its ture it runs the code that you would skip if false. It took exactly 3 lines to make this work, the comment, the condition, and the end/if.

Bill

I use this all the time with pictures of a part set-up. It asks if the operator would like to see a picture of the set-up. YES and the pic pops up, NO and it skips the pic and goes on it's merry way. Pretty easy.

John Kingston
01-23-2008, 02:58 PM
Bill,

Here is what I do....

C1 =COMMENT/YESNO,Run Manual Alignment?
IF_GOTO/C1.INPUT=="NO",GOTO = L1
F1 =FEAT/PLANE,RECT
THEO/15.0317,-19.4311,-17.3088,-0.0003581,-0.0177169,0.999843
ACTL/3.863,-18.5774,-17.2303,-0.0085609,-0.0024601,0.9999603
MEAS/PLANE,3
HIT/BASIC,14.4963,-19.556,-17.3112,-0.0003581,-0.0177169,0.999843,3.3072,-18.7043,-17.2354
HIT/BASIC,14.4965,-19.3689,-17.3079,-0.0003581,-0.0177169,0.999843,3.3074,-18.514,-17.2349
HIT/BASIC,16.1023,-19.3684,-17.3073,-0.0003581,-0.0177169,0.999843,4.974,-18.5129,-17.2206
ENDMEAS/
F2 =FEAT/LINE,RECT,UNBND
THEO/14.4062,-19.6311,-17.4194,0.9999983,-0.0018271,0
ACTL/3.2681,-18.7563,-17.2851,0.9998809,-0.0154331,0
MEAS/LINE,2,WORKPLANE
HIT/BASIC,14.4062,-19.6311,-17.4194,-0.0018271,-0.9999983,0,3.2679,-18.7563,-17.2851
HIT/BASIC,16.1373,-19.6343,-17.4195,-0.0018271,-0.9999983,0,5.0043,-18.7831,-17.2851
ENDMEAS/
F3 =FEAT/POINT,RECT
THEO/14.5718,-19.4765,-17.4179,1,0,0
ACTL/3.3903,-18.6441,-17.2851,0.9999991,0.0009556,0.0009556
MEAS/POINT,1
HIT/BASIC,14.5718,-19.4765,-17.4179,1,0,0,3.3903,-18.6441,-17.2851
ENDMEAS/
A0 =ALIGNMENT/START,RECALL:STARTUP, LIST= YES
ALIGNMENT/LEVEL,ZPLUS,F1
ALIGNMENT/ROTATE,XPLUS,TO,F2,ABOUT,ZPLUS
ALIGNMENT/TRANS,XAXIS,F3
ALIGNMENT/TRANS,YAXIS,F2
ALIGNMENT/TRANS,ZAXIS,F1
ALIGNMENT/END
MODE/DCC
L1 =LABEL/


I use this all the time. I set the part up on my Rayco plate. I run the first one. Then tell the operator to always answer NO. The program goes right into the measurement stage (skips the section that is red). Is this what you were trying to say?

Goodluck
01-23-2008, 03:08 PM
A tip...

If you normally skip the section of code, word it such that the answer "yes" will skip it.

"Do you want to skip..."

Rather than

"Do you want to run..."

That way, when you run the program depressing the 'done' button or hitting enter on the keyboard will skip it since "yes" is the default highlighted answer.


Another tip, if you are going to be using this on several programs, keep the wording the same so that when it pops up and they don't read it because they think they know what it says, you don't get called about a crash.

cmmguy
01-23-2008, 03:09 PM
good tip

Goodluck
01-23-2008, 03:11 PM
good tip

I made the mistake of doing it the other way and don't want to change it now for fear of the second tip.

It doesn't hurt to make "yes" (the default) the safe answer that will avoid the crash rather than causing it.

cmmguy
01-23-2008, 03:16 PM
Exploiting the default answer is the good part... having it crash because the guy just hit the enter key sucks.

Bill McCafferty
01-23-2008, 04:12 PM
Bill,

Here is what I do....



I use this all the time. I set the part up on my Rayco plate. I run the first one. Then tell the operator to always answer NO. The program goes right into the measurement stage (skips the section that is red). Is this what you were trying to say?



Something like that however the way I did it there isn't any need for labels. If C1= NO, the program drops directly to the ENDIF statement and keeps running from that point. If C1=YES it runs all of the code from the condition statement on. Yours is considerably more elaborate than what I was doing. Here is that section of code....


C1 =COMMENT/YESNO,NO,Is the end sub assembly present
IF/C1.INPUT=="YES"
TIP/T1A0B0, SHANKIJK=0.002, -0.001, 1, ANGLE=0.565
MOVE/POINT,NORMAL,598.352,714.458,714.92
PLN1 =AUTO/PLANE,SHOWALLPARAMS = YES,SHOWHITS = NO
THEO/586.18,713,679.62,0.9061065,0,0.4230497
ACTL/1357.398,-535.242,-877.093,0.9053234,-0.001671,0.4247195
TARG/595.5,708.5,680,0.9061065,0,0.4230497
ACTL_THICKNESS = 0,RECT,TRIANGLE,$
AUTO MOVE = NO,DISTANCE = 10,RMEAS = None,None,None,$
NUMHITS = 3,NUMROWS = 1,SPACER = 7.5,RADIAL,$
ANGLE VEC = -0.4230497,0,0.9061065
MOVE/POINT,NORMAL,592.233,711.79,751.844
COMMENT/OPER,NO,
,Insert a shoulder bolt into threaded hole below probe
,
CYL1 =AUTO/CYLINDER,SHOWALLPARAMS = YES,SHOWHITS = NO
THEO/586.18,713,679.62,0.9061065,0,0.4230497,6,12
ACTL/595.503,708.501,679.997,0.9061065,-0.000001,0.4230497,6,12
TARG/595.5,708.5,680,0.9061065,0,0.4230497
ACTL_THICKNESS = 0,RECT,OUT,CIRCULAR,LEAST_SQR,ONERROR = NO,$
AUTO MOVE = NO,DISTANCE = 10,RMEAS = None,None,None,$
READ POS = NO,FIND HOLE = NO,REMEASURE = NO,USE THEO = NO,$
NUMHITS = 3,NUMROWS = 3,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
START ANG = 0,END ANG = 180,DEPTH = 5,$
ANGLE VEC = 0,1,0
CIR1 =FEAT/CIRCLE,RECT,OUT
THEO/586.18,713,679.62,0.9061065,0,0.4230497,6
ACTL/595.503,708.501,679.997,0.9061065,-0.000001,0.4230497,6
CONSTR/CIRCLE,INTOF,CYL1,PLN1
DIM LOC1= LOCATION OF CIRCLE CIR1 UNITS=MM ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
X 586.180 1.000 1.000 595.500 9.320 B 8.320 -------->
Y 713.000 1.000 1.000 708.500 -4.500 I 3.500 <--------
Z 679.620 1.000 1.000 680.000 0.380 H 0.000 ------#--
END OF DIMENSION LOC1
MOVE/POINT,NORMAL,592.233,711.791,751.844
COMMENT/OPER,NO,
, Remove the shoulder bolt
,
MOVE/POINT,NORMAL,801.064,686.793,606.377
PLN2 =AUTO/PLANE,SHOWALLPARAMS = YES,SHOWHITS = NO
THEO/793.94,685,562.57,0.9061065,0,0.4230497
ACTL/795.003,677.001,550.997,0.9061065,-0.000001,0.4230497
TARG/795,677,551,0.9061065,0,0.4230497
ACTL_THICKNESS = 0,RECT,TRIANGLE,$
AUTO MOVE = NO,DISTANCE = 10,RMEAS = None,None,None,$
NUMHITS = 3,NUMROWS = 1,SPACER = 10,RADIAL,$
ANGLE VEC = 0,0,1
MOVE/POINT,NORMAL,801.124,686.776,637.712
COMMENT/OPER,NO,
,Insert a shoulder bolt into threaded hole below probe
,
CYL2 =AUTO/CYLINDER,SHOWALLPARAMS = YES,SHOWHITS = NO
THEO/793.94,685,562.57,0.9061065,0,0.4230497,6,12
ACTL/793.943,685.001,562.567,0.9061065,-0.000001,0.4230497,6,12
TARG/793.94,685,562.57,0.9061065,0,0.4230497
ACTL_THICKNESS = 0,RECT,OUT,CIRCULAR,LEAST_SQR,ONERROR = NO,$
AUTO MOVE = NO,DISTANCE = 10,RMEAS = None,None,None,$
READ POS = NO,FIND HOLE = NO,REMEASURE = NO,USE THEO = NO,$
NUMHITS = 3,NUMROWS = 3,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
START ANG = 0,END ANG = 180,DEPTH = 5,$
ANGLE VEC = 0,1,0
CIR2 =FEAT/CIRCLE,RECT,OUT
THEO/793.94,685,562.57,0.9061065,0,0.4230497,6
ACTL/790.378,685.001,560.903,0.9061065,-0.000001,0.4230497,6
CONSTR/CIRCLE,INTOF,CYL2,PLN2
DIM LOC2= LOCATION OF CIRCLE CIR2 UNITS=MM ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
X 793.940 1.000 1.000 790.375 -3.565 F 2.565 <--------
Y 685.000 1.000 1.000 685.000 0.000 0.000 ----#----
Z 562.570 1.000 1.000 560.906 -1.664 L 0.664 <--------
END OF DIMENSION LOC2
MOVE/POINT,NORMAL,801.125,686.776,637.711
COMMENT/OPER,NO,
, Remove the shoulder bolt
,
TIP/T1A75B-127.5, SHANKIJK=0.768, -0.587, 0.257, ANGLE=-101.143
MOVE/POINT,NORMAL,627.647,643.273,680.7
MOVE/POINT,NORMAL,607.461,687.861,586.106
COMMENT/OPER,NO,
,Insert a shoulder bolt into threaded hole below probe
,
CYL3 =AUTO/CYLINDER,SHOWALLPARAMS = YES,SHOWHITS = NO
THEO/574,702.5,585,0,-1,0,9,22
ACTL/574.003,702.501,584.997,-0.000002,-1,0.0000018,9,22
TARG/574,702.5,585,0,-1,0
ACTL_THICKNESS = 0,RECT,OUT,CIRCULAR,LEAST_SQR,ONERROR = NO,$
AUTO MOVE = NO,DISTANCE = 10,RMEAS = None,None,None,$
READ POS = NO,FIND HOLE = NO,REMEASURE = NO,USE THEO = NO,$
NUMHITS = 3,NUMROWS = 3,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
START ANG = 45,END ANG = 180,DEPTH = 14,$
ANGLE VEC = 0,0,-1
DIM LOC3= LOCATION OF CYLINDER CYL3 UNITS=MM ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
X 574.000 1.000 1.000 574.000 0.000 0.000 ----#----
Z 585.000 1.000 1.000 585.000 0.000 0.000 ----#----
END OF DIMENSION LOC3
MOVE/POINT,NORMAL,649.238,638.931,591.385
COMMENT/OPER,NO,
, Remove the shoulder bolt
,
MOVE/POINT,NORMAL,649.237,638.932,591.384
MOVE/POINT,NORMAL,603.084,688.669,470.533
COMMENT/OPER,NO,
,Insert a shoulder bolt into threaded hole below probe
,
CYL4 =AUTO/CYLINDER,SHOWALLPARAMS = YES,SHOWHITS = NO
THEO/583,702.5,471.499,0,-1,0,8.999,22
ACTL/583.003,702.501,471.496,-0.000002,-1,0.0000018,8.999,22
TARG/583,702.5,471.499,0,-1,0
ACTL_THICKNESS = 0,RECT,OUT,CIRCULAR,LEAST_SQR,ONERROR = NO,$
AUTO MOVE = NO,DISTANCE = 10,RMEAS = None,None,None,$
READ POS = NO,FIND HOLE = NO,REMEASURE = NO,USE THEO = NO,$
NUMHITS = 3,NUMROWS = 3,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
START ANG = 30,END ANG = 200,DEPTH = 14,$
ANGLE VEC = 0,0,-1
DIM LOC4= LOCATION OF CYLINDER CYL4 UNITS=MM ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
X 583.000 0.500 0.500 583.000 0.000 0.000 ----#----
Z 471.499 0.500 0.500 471.499 0.000 0.000 ----#----
END OF DIMENSION LOC4
MOVE/POINT,NORMAL,603.083,688.668,470.533
MOVE/POINT,NORMAL,724.028,570.091,620.075
COMMENT/OPER,NO,
, Remove the shoulder bolt
,
END_IF/

djayne
02-19-2008, 04:59 PM
To carry this one step further:
I would like to output the Yes/No as a stat to WinSPC. I tried to do a second if/end if with a variable set to 0 or 1 depending on the answer. I made a constructed feature and put this variable in the Z-axis coordinate and then toleranced out the Z position of that feature. With the "no" answer being zero which would make the feature Out of Spec and the quality technician would have to assign a cause in our WinSPC software. The trouble is, it reads the last variable every time no matter what answer was selected.

Perry Fisher
02-19-2008, 05:06 PM
Another tip, if you are going to be using this on several programs, keep the wording the same so that when it pops up and they don't read it because they think they know what it says, you don't get called about a crash.

Create a dummy program with all the necessary skiping code then copy and paste into your active program. I do that with looping routines for capability studies.

Goodluck
02-20-2008, 09:12 AM
To carry this one step further:
I would like to output the Yes/No as a stat to WinSPC. I tried to do a second if/end if with a variable set to 0 or 1 depending on the answer. I made a constructed feature and put this variable in the Z-axis coordinate and then toleranced out the Z position of that feature. With the "no" answer being zero which would make the feature Out of Spec and the quality technician would have to assign a cause in our WinSPC software. The trouble is, it reads the last variable every time no matter what answer was selected.

Code?

I'd guess maybe you've got something not quite right in the if statement. Is anything showing red?

djayne
02-25-2008, 10:21 AM
C3 =COMMENT/YESNO,YES,Do all machine surfaces comply with surface finish standard?
IF/C3.INPUT=="NO"
COMMENT/OPER,YES,If machined surfaces do not comply with customer specifications,
,please indicate a cause and corrective action in WinSPC.
,Also include any Surface Test Results and Corrective and Quarateen actions.
,
,If you need any assistance, please contact a Quality Tech.
END_IF/

assign/v3 = C3.input
If/v3=="yes"
Assign/v4 = 0
End_if/
If/v3=="no"
Assign/v4 = -1
End_if/

Surface Finish=feat/point,rect
Theo/0,0,0,0,0,-1
Actl/0,0,0,0,0,-1
Constr/point,proj,origin,inletflange
Surfacefinishvisual=feat/point,rect
Theo/0,0,1,0,0,-1
Actl/0,0,-1,0,0,-1
Constr/point,offset,surface Finish,0,0,v4
Dim Surfacefinish= Location Of Point Surfacefinishvisual Units=mm ,$
Graph=off Text=off Mult=10.00 Output=both
Ax Nominal +tol -tol Meas Dev
Z 1.000 0.000 0.000 -1.000 -2.000 <--------
End Of Dimension Surfacefinish

This should be fairly simple. I'm trying to put the Yes/No into a feature so it will create a 0 or 1 for good/no good. If it is no good, I want to be able to go into our WinSPC software and assign a cause and corrective action.
The first portion works like expected as far as the Yes/No.

xyz_ijk
02-25-2008, 10:26 AM
COM1 =COMMENT/INPUT,DO YOU NEED TO MANUALLY ALIGN THIS PART
,1---YES
,2---NO
IF_GOTO/COM1.INPUT=="1",GOTO = MANUAL
IF_GOTO/COM1.INPUT=="2",GOTO = AUTO
GOTO/END_PROGRAM


something like that?

xyz_ijk
02-25-2008, 10:27 AM
then just put the labels where you need them

djayne
02-25-2008, 10:37 AM
Yes. I would be nice if I could input a numerical value but for Ford and Chrysler I actually need it to have a "yes" or "no" choice. I had the if goto to labels in the original program but the customers weren't happy with it.

tinman
03-24-2008, 02:26 PM
Nope no spelling either.. The YES/NO comment starts with YES NO and CANCEL buttons and it's a clicker ONLY; no typing at all. Thats why I wanted to use this one.

Bill

can you post a shortened version of the program using this here please?
thank you.....:D

craiger_ny
03-24-2008, 02:39 PM
can you post a shortened version of the program using this here please?
thank you.....:D

The syntax is a string evaluation commentname.input == "yes" or commentname.input == "no"


C1 =COMMENT/YESNO,NO,"comment text here"


Then evaluate C1.INPUT

T Miller
03-24-2008, 03:01 PM
C1 =COMMENT/YESNO,******************************************** *******
, Do You Need To Manualy Align Part?
, This Only Needs To Be Done For First
, Of A New Set Up!
,************************************************* **
,
IF/C1.INPUT == "YES"

manalign stuff
END_IF/

for a manual alignment I just use the end_if