hexagon logo

Case statement help

Having trouble getting this to work. In the input field I have entered 3. My c1 variable should be 1.378 in the auto circle at the end of the code. it is showing in my auto feature as the 5th case - as if it is returning a false value? Can anyone look at the code below and see the issue?
2011 Mr1 - offline seat.
Thanks!!

DO/
C20 =COMMENT/INPUT,NO,FULL SCREEN=NO,
enter a digit for part number.
81024905 TYPE - 1
81024904 TYPE - 2
81024903 TYPE - 3
81024901 TYPE - 4
81024900 TYPE - 5
SELECT/C20.INPUT
CASE/1
ASSIGN/A1=4.132
ASSIGN/B1=.378
ASSIGN/C1=1.614
ASSIGN/D1=.704
END_CASE/
CASE/2
ASSIGN/A1=4.073
ASSIGN/B1=.473
ASSIGN/C1=1.496
ASSIGN/D1=.704
END_CASE/
CASE/3
ASSIGN/A1=4.014
ASSIGN/B1=.496
ASSIGN/C1=1.378
ASSIGN/D1=.704
END_CASE/
CASE/4
ASSIGN/A1=3.955
ASSIGN/B1=.555
ASSIGN/C1=1.26
ASSIGN/D1=.604
END_CASE/
CASE/5
ASSIGN/A1=3.896
ASSIGN/B1=.614
ASSIGN/C1=1.142
ASSIGN/D1=.604
END_CASE/
END_SELECT/
UNTIL/C20.INPUT >1 OR C20.INPUT <5
BOLT HOLE 2=FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
THEO/<0,0.03,0>,<0,-1,0>,C1,0
ACTL/<0,0.03,0>,<0,-1,0>,1.142,0
TARG/<0,0.03,0>,<0,-1,0>
START ANG=0,END ANG=360
ANGLE VEC=<1,0,0>
DIRECTION=CCW
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=YES
NUMHITS=3,DEPTH=0,PITCH=0
SAMPLE HITS=0,SPACER=0
AVOIDANCE MOVE=BOTH,DISTANCE=0.5
FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
SHOW HITS=NO
Parents
  • If you insert a break point before your logic begins the program will run continuously up to the break point and will then stop and allow you to step through the program line by line in single block mode. During this time the execution is considered to be live and you can hover your cursor over any variable to see the value as it will be during normal part execution. You can also edit the code in this mode so you don't have to make a list of all the changes you want to make and the go back after the execution has completed and put them all in. You can make your changes right then and there as the code is executing.

    Some things still won't execute exactly right. For example, I have seen relearn scans continue to execute with the last populated variable values even though when you hover over the variable itself it shows a different value. Still, even with a few glitches, this is a very valuable debugging method. You can do this in both offline and online mode but I would be a bit cautious about dynamically changing the code in online mode.
Reply
  • If you insert a break point before your logic begins the program will run continuously up to the break point and will then stop and allow you to step through the program line by line in single block mode. During this time the execution is considered to be live and you can hover your cursor over any variable to see the value as it will be during normal part execution. You can also edit the code in this mode so you don't have to make a list of all the changes you want to make and the go back after the execution has completed and put them all in. You can make your changes right then and there as the code is executing.

    Some things still won't execute exactly right. For example, I have seen relearn scans continue to execute with the last populated variable values even though when you hover over the variable itself it shows a different value. Still, even with a few glitches, this is a very valuable debugging method. You can do this in both offline and online mode but I would be a bit cautious about dynamically changing the code in online mode.
Children
No Data