Looping

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

  • Looping

    Hi All
    I was wondering what you do to get the loop to move in the x direction. I have written one to go in the Y direction for as many pieces I want but cannot get it to go in the x direction if I need to do another row. I understand it is a loop inside a loop but I am having a hard time getting it down any help would be great.

    Thanks
    Since I gave up hope I feel much better !!!

  • #2
    put the cursor in the front of first loop , define looping parameters , then move the cursor at the end the first loop , choose end loop command.

    Hope this helps
    Maq

    V2 =LOOP/START, ID = YES, NUMBER = 3, START = 1, SKIP = ,
    OFFSET: XAXIS = 20, YAXIS = 0, ZAXIS = 0, ANGLE = 0
    V1 =LOOP/START, ID = YES, NUMBER = 3, START = 1, SKIP = ,
    OFFSET: XAXIS = 0, YAXIS = 20, ZAXIS = 0, ANGLE = 0
    CAP1 =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
    THEO/0,0,0,1,0,0,11
    ACTL/0,0,0,1,0,0,11
    TARG/0,0,0,1,0,0
    THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,NORM,ONERROR = NO,$
    AUTO MOVE = NO,DISTANCE = 50,RMEAS = None,None,None,$
    READ POS = NO,FIND HOLE = NO,REMEASURE = NO,$
    NUMHITS = 4,INIT = 0,PERM = 0,SPACER = 2.5,PITCH = 0,$
    START ANG = 0,END ANG = 0,DEPTH = 1,$
    ANGLE VEC = 0,0,1,$
    PUNCH = 1,0,0,PIN = 1,0,0
    LOOP/END
    LOOP/END
    Last edited by Maqboul; 10-05-2006, 04:18 PM.
    sigpic

    Comment


    • #3
      Originally posted by Ken379128
      Hi All
      I was wondering what you do to get the loop to move in the x direction. I have written one to go in the Y direction for as many pieces I want but cannot get it to go in the x direction if I need to do another row. I understand it is a loop inside a loop but I am having a hard time getting it down any help would be great.

      Thanks
      Ken,
      I just learned all this myself. What I do is this:
      I put in the first loop and tell it how many parts in that direction.
      Second I put in another loop right after the first one and tell it how many rows.

      Here is a short program I have for checking the Diam of a ring. It has 5 parts right to left and 4 rows from front to back for a total of 20 parts.
      If you don't understand it. PM me and I will try to walk you through it.

      STARTUP =ALIGNMENT/START,RECALL:, LIST= YES
      ALIGNMENT/END
      MODE/MANUAL
      LOADPROBE/1_5BY40MM
      TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
      FORMAT/TEXT, ,HEADINGS, , ;MEAS,NOM,TOL,DEV,OUTTOL, ,
      STATS/ON,DATAPAGE,$
      DIRECTORY=C:\DATAPAGE\RETAINER,$
      DIRECTORY=,$
      READ=10,WRITE=20,MEMPAGES=4,DIMENSION NAME,CONTROLCALC OFF,$
      STATS/END
      V1 =LOOP/START, ID = YES, NUMBER = 5, START = 5, SKIP = ,
      OFFSET: XAXIS = 4, YAXIS = 0, ZAXIS = 0, ANGLE = 0
      V2 =LOOP/START, ID = YES, NUMBER = 4, START = 1, SKIP = ,
      OFFSET: XAXIS = 0, YAXIS = 4, ZAXIS = 0, ANGLE = 0

      MODE/DCC
      PREHIT/ 0.1
      RETRACT/ 0.1
      FLY/ON,0.125
      MOVESPEED/ 60
      MOVE/POINT,3.6204,3.4777,-25.029
      CIR2 =AUTO/, SHOWALLPARAMS=YES, SHOWHITS=YES
      THEO/5.546,2.2137,-26.84,0,0,1,3.2035,0
      ACTL/5.5326,2.1344,-26.84,0,0,1,3.2032,0
      TARG/5.546,2.2137,-26.84,0,0,1
      THEO_THICKNESS = 0, RECT, OUT, CIRCULAR, LEAST_SQR, ONERROR = NO ,$
      AUTO MOVE = NO, DISTANCE = 0.15, RMEAS = None, READ POS = NO, FIND HOLE = NO, REMEASURE = NO ,$
      NUMHITS = 18, INIT = 0, PERM = 0, SPACER = 0, PITCH = 0 ,$
      START ANG = 180, END ANG = 540, DEPTH = 0.0009 ,$
      ANGLE VEC = 1,0,0
      MEAS/CIRCLE
      HIT/BASIC,3.9443,2.2137,-26.8391,-1,0,0,3.9329,2.2137,-26.8391
      HIT/BASIC,4.0408,1.6659,-26.8391,-0.9396926,-0.3420201,0,4.0051,1.6527,-26.8392
      HIT/BASIC,4.319,1.1841,-26.8391,-0.7660444,-0.6427876,0,4.2732,1.145,-26.8392
      HIT/BASIC,4.7451,0.8265,-26.8391,-0.5,-0.8660254,0,4.7079,0.7613,-26.8391
      HIT/BASIC,5.2679,0.6363,-26.8391,-0.1736482,-0.9848078,0,5.2543,0.5579,-26.8391
      HIT/BASIC,5.8241,0.6363,-26.8391,0.1736482,-0.9848078,0,5.839,0.5623,-26.839
      HIT/BASIC,6.3469,0.8265,-26.8391,0.5,-0.8660254,0,6.3781,0.7742,-26.839
      HIT/BASIC,6.773,1.1841,-26.8391,0.7660444,-0.6427876,0,6.8032,1.1594,-26.8389
      HIT/BASIC,7.0512,1.6659,-26.8391,0.9396926,-0.3420201,0,7.0629,1.6615,-26.839
      HIT/BASIC,7.1477,2.2137,-26.8391,1,0,0,7.1325,2.2138,-26.8391
      HIT/BASIC,7.0512,2.7615,-26.8391,0.9396926,0.3420201,0,7.0124,2.7477,-26.8392
      HIT/BASIC,6.773,3.2433,-26.8391,0.7660444,0.6427876,0,6.7251,3.2037,-26.8392
      HIT/BASIC,6.3469,3.6009,-26.8391,0.5,0.8660254,0,6.3092,3.535,-26.8391
      HIT/BASIC,5.8241,3.7911,-26.8391,0.1736482,0.9848078,0,5.8102,3.7114,-26.839
      HIT/BASIC,5.2679,3.7911,-26.8391,-0.1736482,0.9848078,0,5.2814,3.716,-26.839
      HIT/BASIC,4.7451,3.6009,-26.8391,-0.5,0.8660254,0,4.7769,3.5465,-26.839
      HIT/BASIC,4.319,3.2433,-26.8391,-0.7660444,0.6427876,0,4.3513,3.2162,-26.839
      HIT/BASIC,4.0408,2.7615,-26.8391,-0.9396926,0.3420201,0,4.0561,2.7559,-26.839
      ENDMEAS/
      Last edited by B. Jacobs; 10-05-2006, 04:02 PM.
      B. Jacobs
      B&S Global 12.15.10
      2014.1

      Comment


      • #4
        I am guessing you want to first icrement through a row of parts that run along the Y axis then move over in the X axis and run another row along the Y the same as you did the first? Is this what you are shooting for? If so nest your loops. Let us know exactly what pattern on your table you'd like to increment things along in and we can post some code explaining it to you.

        Craig
        <internet bumper sticker goes here>

        Comment


        • #5
          Nest it like Maq was saying. OK, Bryan will get you squared away. Loops are fun, but then I'm kinda loopy myself. I'm gonna go home now and get good and looped, got a new keg on tap!

          TK
          sigpicHave a homebrew

          Comment


          • #6
            Lets say you have 6 parts all lined up along the Y axis 2 inches apart. Then 2 inches over in the X axis you have another row and a third 2 inches over from that. You want to measure the parts first along the Y axis then move over 2 inches in the X and do it all over again until you have done 3 rows of 6 along the X axis. Your code would look like this:

            Code:
            X_LOOP     =LOOP/START, ID = YES, NUMBER = 3, START = 1, SKIP = ,
                           OFFSET: XAXIS = 2, YAXIS = 0, ZAXIS = 0, ANGLE = 0
            Y_LOOP     =LOOP/START, ID = YES, NUMBER = 6, START = 1, SKIP = ,
                           OFFSET: XAXIS = 0, YAXIS = 2, ZAXIS = 0, ANGLE = 0
            LOOPED_FEATURE=FEAT/CIRCLE,RECT,OUT,LEAST_SQR
                        THEO/0,0,0,0,0,1,1
                        ACTL/0,0,0,0,0,1,1
                        MEAS/CIRCLE,4,WORKPLANE
                        HIT/BASIC,NORMAL,0.5,0,0,1,0,0,0.5,0,0,USE THEO = YES
                        MOVE/CIRCULAR
                        HIT/BASIC,NORMAL,0,0.5,0,0,1,0,0,0.5,0,USE THEO = YES
                        MOVE/CIRCULAR
                        HIT/BASIC,NORMAL,-0.5,0,0,-1,0,0,-0.5,0,0,USE THEO = YES
                        MOVE/CIRCULAR
                        HIT/BASIC,NORMAL,0,-0.5,0,0,-1,0,0,-0.5,0,USE THEO = YES
                        ENDMEAS/
            DIM LOOPED_DIMENSION= LOCATION OF CIRCLE LOOPED_FEATURE  UNITS=IN ,$
            GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH
            AX   NOMINAL     +TOL       -TOL       MEAS        DEV      OUTTOL   
            D      1.0000     0.0050     0.0050     1.0000     0.0000     0.0000 ----#----
            END OF DIMENSION LOOPED_DIMENSION
                        LOOP/END
                        LOOP/END
            Of course I just threw a diameter in there as an example. Your program code would go there including a clearplane I assume so that you are not crashing but if you already use loops you know about that.

            Craig
            <internet bumper sticker goes here>

            Comment


            • #7
              As mentioned above , i did a loop with my offline both 3.7mr2_1 and 4.1 versions.

              This happened...
              Attached Files
              sigpic

              Comment


              • #8
                Those are your index numbers.

                Craig
                <internet bumper sticker goes here>

                Comment


                • #9
                  i know ; for the first loop everything appears correctly , but for the second one the appearance is not correct !
                  sigpic

                  Comment


                  • #10
                    Sorry ; i forgot to change the normal vector of the circle... it works fine..
                    sigpic

                    Comment


                    • #11
                      Thanks all I will try the ideas out and let you know if I get time on the machine.
                      Since I gave up hope I feel much better !!!

                      Comment


                      • #12
                        Curious - what aligning are you planning on for the parts? Will your fixture be temporary, or will it be on the machine for a while? Our two cmm's have permanently-mounted fixtures, one with 13 stations and one with 20 stations. They have 13 and 20 external fixture alignments, respectively. My programs have DO loops that recall these alignments. Within the loop is the part alignment, which is done at each station, using hits both on the fixture and on the part.

                        Comment

                        Related Topics

                        Collapse

                        • zonionman
                          Looping Features
                          by zonionman
                          I am trying to teach myself about looping and I was curious if there was a way to create a new feature with each iteration of a loop. I used a code that...
                          07-17-2013, 04:36 PM
                        • JamesMannes
                          Looping
                          by JamesMannes
                          Looping a program is a way of running parts on a dedicated fixture that holds multiple parts.

                          This explanation was given to me by craiger_ny...
                          04-07-2007, 08:24 PM
                        • m2measure
                          Loop/end
                          by m2measure
                          I am not sure what is happening. I am using PC-DMIS 4.1 and I have created a nested loop and when I run the program the loop/end statement turns red....
                          01-31-2008, 07:27 PM
                        • mjdevries
                          Loop Statement ID=YES/NO ?
                          by mjdevries
                          Here is a typical loop statement

                          V1 =LOOP/START, ID = YES, NUMBER = 8, START = 1, SKIP = ,
                          OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS =...
                          04-02-2009, 12:13 AM
                        • louisd
                          Loopity loopy loops
                          by louisd
                          I'm trying to optimize path of a routine that measures anywhere from 1 to 4 parts set on a fixture (variable QTY.INPUT). Fixture positions are spaced...
                          10-10-2018, 05:49 PM
                        Working...
                        X