Help With If_GoTo

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help With If_GoTo

    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 outer diameter.

    I have a comment put in that requires input (size of the od that will be run).

    I have labels put in at the beginning of each one of the diameters that I would be measuring.

    I can't figure out how to get the software to go to the correct diameter size based on input to measure.

    Any help would be greatly appreciated.

    Rodney

  • #2
    quick & dirty, 5 possible diameters, 1, 2, 3, 4, 5

    Code:
    L1         =LABEL/
    C1         =COMMENT/INPUT,YES,diameter (1, 2, 3, 4, or 5)
                IF_GOTO/C1.INPUT<1,GOTO = L1
                IF_GOTO/C1.INPUT>5,GOTO = L1
                IF_GOTO/C1.INPUT<2,GOTO = L2
                IF_GOTO/C1.INPUT<3,GOTO = L3
                IF_GOTO/C1.INPUT<4,GOTO = L4
                IF_GOTO/C1.INPUT<5,GOTO = L5
                IF_GOTO/C1.INPUT<6,GOTO = L6
    L2         =LABEL/
                COMMENT/DOC,YES,code for circle goes here
                GOTO/L7
    L3         =LABEL/
                COMMENT/DOC,YES,code for circle goes here
                GOTO/L7
    L4         =LABEL/
                COMMENT/DOC,YES,code for circle goes here
                GOTO/L7
    L5         =LABEL/
                COMMENT/DOC,YES,code for circle goes here
                GOTO/L7
    L6         =LABEL/
                COMMENT/DOC,YES,code for circle goes here
                GOTO/L7
    L7         =LABEL/
    I do NOT know why, but you can NOT use = in the IF_GOTO. I've always hated that, unless they have changed it in a newer version.

    First two IF_GOTO loops back to before the operator input, in case they put in a value that is not right
    sigpic
    Originally posted by AndersI
    I've got one from September 2006 (bug ticket) which has finally been fixed in 2013.

    Comment


    • #3
      Something like this might work for you.
      Code:
      V2         =COMMENT/INPUT,YES,'What is the ring nominal size (inch) ?'
                  COMMENT/REPT,
                              ,
                  ASSIGN/RINGSIZE = V2.INPUT
      RING       =AUTO/CYLINDER,SHOWALLPARAMS = NO,SHOWHITS = NO
                  THEO/0,0,0,0,0,-1,V2.INPUT
                  ACTL/0.0008,-0.0002,0,0.0000979,-0.0003791,-0.9999999,0.4826
                  TARG/0,0,0,0,0,-1
      TK
      sigpicHave a homebrew

      Comment


      • #4
        Something like this, just substitute the options I have for your diameter sizes. Put a label "START" at the beginning of the program and a GOTO/START at the end of each measurement routine to end the part you're measuring. HTH.
        START =LABEL/
        C1 =COMMENT/INPUT,YES,FULL SCREEN=NO,
        SELECT EXECUTION OPTION:
        1 - Run Alignment
        2 - Run 1 Part
        3 - Run Multiple Parts
        4 - End Program
        IF_GOTO/C1.INPUT==1,GOTO = ALIGNMENT
        IF_GOTO/C1.INPUT==2,GOTO = EXECUTE
        IF_GOTO/C1.INPUT==3,GOTO = STUDY
        IF_GOTO/C1.INPUT==4,GOTO = END
        IF_GOTO/C1.INPUT>4,GOTO = INVALID
        INVALID =LABEL/
        COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,


        <<< INVALID INPUT >>>

        GOTO/START

        Comment


        • #5
          Code:
          VERSION    =COMMENT/INPUT,YES,FULL SCREEN=NO,
                      'IS THIS TWIN CRANKCASE VERSION 24560...
                     
                      1. 13?
                      2. 17?
                      3. 65?
                      4. 70?
                      '
                      SELECT/VERSION.INPUT
                      CASE/1
                      ASSIGN/SLEEVE_DIAMETER=73.5
                      END_CASE/
                      CASE/2
                      ASSIGN/SLEEVE_DIAMETER=76.5
                      END_CASE/
                      CASE/3
                      ASSIGN/SLEEVE_DIAMETER=79.5
                      END_CASE/
                      CASE/4
                      ASSIGN/SLEEVE_DIAMETER=79.5
                      END_CASE/
                      DEFAULT_CASE/
                      COMMENT/OPER,YES,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                      INCORRECT VALUE INPUT FOR VERSION NUMBER
                      GOTO/ENDO
                      END_DEFAULTCASE/
                      END_SELECT/
           
          ...measurement of features...
           
           
           MOVE/CLEARPLANE
          CYL1_TOP   =FEAT/CONTACT/CIRCLE,CARTESIAN,IN,MAX_INSC
                      THEO/<0.033,0,175.531>,<0.0001268,0,1>,SLEEVE_DIAMETER
                      ACTL/<-0.111,0.113,175.569>,<0.0001268,0,1>,79.063
                      TARG/<0.033,0,175.531>,<0.0001268,0,1>
                      START ANG=360,END ANG=720
                      ANGLE VEC=<1,0,-0.0002536>
                      DIRECTION=CCW
                      SHOW FEATURE PARAMETERS=NO
                      SHOW CONTACT PARAMETERS=NO
                      MOVE/CLEARPLANE
           
           
          ...reporting of features...
           
          CYL1_TOP_TP =POSITION OF CYL1_TOP
                      FEATCTRLFRAME/SHOWNOMS=NO,SHOWPARAMS=NO,SHOWEXPANDED=NO
                        SIZE TOLERANCES/1,DIAMETER,SLEEVE_DIAMETER,0.25,0.25
                        PRIMARY DIMENSION/POSITION,DIAMETER,0.8,LMC,A,B, ,C
                        NOTE/CYL1_TOP_TP
                      FEATURES/CYL1_TOP,,
          .
          Last edited by JamesMannes; 01-19-2015, 03:40 PM.
          sigpic

          James Mannes

          Comment


          • #6
            Thanks for all of your help. It's nice to be able to get help when needed in a crunch situaltion.

            Rodney

            Comment


            • #7
              what about CASE/SELECT ?
              ex.:
              Code:
                          DO/
              C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                          CHOOSE PART NUMBER 1 2 OR 3
                          UNTIL/(C1.INPUT=="1") OR (C1.INPUT=="2") OR (C1.INPUT=="3")
                          SELECT/C1.INPUT
                          CASE/1
                          ASSIGN/VDIAM=10.125
                          END_CASE/
                          CASE/2
                          ASSIGN/VDIAM=10.250
                          END_CASE/
                          CASE/3
                          ASSIGN/VDIAM=10.750
                          END_CASE/
                          END_SELECT/
                 
              (some time later)
                 
                          MOVE/CLEARPLANE
              CIR1       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,MIN_CIRCSC
                          THEO/<0,0,0>,<0,0,1>,VDIAM,0
                          ACTL/<0,0,0>,<0,0,1>,10.75,0
                          TARG/<0,0,0>,<0,0,1>
                          START ANG=0,END ANG=360
                          ANGLE VEC=<1,0,0>
                          DIRECTION=CCW
                          USE_PIN=NO,PUNCH=<0,0,1>,PIN=<0,0,1>
                          REPORT VEC=<0,0,-1>
                          SHOW FEATURE PARAMETERS=NO
                          SHOW CONTACT PARAMETERS=NO
                 
              DIM LOC1= LOCATION OF CIRCLE CIR1  UNITS=MM ,$
              GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
              AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
              D    VDIAM      0.000      0.000     10.750      0.000      0.000 #---------
              END OF DIMENSION LOC1

              EDIT Oh Sonofabiiiiitch..... I see I was beat by 12+ hours
              Last edited by TheyCallMeWoody; 01-20-2015, 09:45 AM.

              Comment

              Related Topics

              Collapse

              Working...
              X