Looping question

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

  • Looping question

    I was asked a question but one of our new inspectors when we were discussing looping. Say you have five parts you want to setup and measures all five. I don't have enough 'X' or 'Y' axis to set them up one after the other in a line, but I could put three in one row and two in the other. I know how to loop this if I had four or six but not five. Is there a straight forward way to loop the five?
    DeWain Hodge

  • #2
    I have the same situation with one of ours. I have one row of three and one row of two.

    Sample program below:

    MANUAL ALIGNMENT

    LOOP1: LOOP Y+ 3 TIMES
    PROGRAM
    DIMENSIONS
    END LOOP

    Kick back into MANUAL ALIGNMENT

    LOOP2: LOOP Y+ 2 TIMES
    PROGRAM (Copied original program with a pattern offset of 1 in X)
    DIMENSIONS
    END LOOP

    Yes, you will have two different feature names for the same dimension. Yes, you will have to have two sets of dimensions with different names. This is what I found that works, unless someone has something better.

    Comment


    • #3
      Use a variable for the second number and change if from 3 to 2 once the second loop begins like this:

      Code:
      V_LOOP1    =LOOP/START,ID=YES,NUMBER=2,START=1,SKIP=,
                    OFFSET:XAXIS=0,YAXIS=2,ZAXIS=0,ANGLE=0
                  IF/V_LOOP1==1
                  ASSIGN/V_NUM=3
                  END_IF/
                  ELSE/
                  ASSIGN/V_NUM=2
                  END_ELSE/
      V_LOOP2    =LOOP/START,ID=YES,NUMBER=[COLOR=#FF0000][B]V_NUM[/B][/COLOR],START=1,SKIP=,
                    OFFSET:XAXIS=2,YAXIS=0,ZAXIS=0,ANGLE=0
      $$ NO,
                  MEASURE PART HERE
                  
                  LOOP/END
                  LOOP/END
      PC-DMIS 2016.0 SP8

      Jeff

      Comment


      • #4
        Nested loops.
        Code:
        V1 = LOOP/START Number = 3
        V2 = LOOP/START Number = 2
        
        your program code here.........
        
        LOOP/END
        
        IF/V1+V2 == 5
        
        GOTO/EXIT_LOOP
        
        LOOP/END
        
        EXIT_LOOP = LABEL/
        Last edited by dph51; 09-16-2016, 03:02 AM.

        B&S CHAMELEON/PCDMIS CAD++ V2011

        There are no bugs, only "UNDOCUMENTED ENHANCEMENTS!"

        sigpic

        Comment


        • #5
          You can also write :
          V1 =LOOP/START,ID=YES,NUMBER=6,START=1,SKIP=6,

          Comment


          • #6
            Nothing to add - two and half very good solutions, but not sure yours would work Jeff as I think he's doing it in two rows
            Automettech - Automated Metrology Technology

            Comment


            • JEFMAN
              JEFMAN commented
              Editing a comment
              I'm glad to have half of a solution

          • #7
            Like this, it could work, I'll give it a try !

            ASSIGN/V4=3
            V1 =LOOP/START,ID=YES,NUMBER=6,START=1,SKIP=6,
            OFFSET:XAXIS=V2,YAXIS=V3,ZAXIS=0,ANGLE=0
            IF/V1<4 ASSIGN/V2= X shift
            ASSIGN/V3=0
            END_IF/
            ELSE/
            ASSIGN/V2= -X shift
            ASSIGN/V3= Y shift(v1-V4)
            ASSIGN/V4=V4+1
            END_ELSE/

            Comment


            • JEFMAN
              JEFMAN commented
              Editing a comment
              I can't make it work !
              Offline, on V2014, it seems that "skip" doesn't work at all !!!!!!!

          • #8
            I might have a solution for you on Monday...if I don't forget! It's posted here somewhere I just cant find it. Basically you can run any number of parts the Operator enters (input comment) and fills a grid from left to right, top to bottom odd or even # of pieces doesn't matter. Does that sound like something that would help? If not there's another solution briefly explained here (Very last comment).
            PcDmis 2015.1 SP10 CAD++
            Global 7-10-7 DC800S

            Comment

            Related Topics

            Collapse

            Working...
            X