Looping a Loop?

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

  • Looping a Loop?

    Good morning all I hope you are all having a good day, I have a program that contains a simple loop to check multiple pockets on a valve rotator body, We have recently set up a few other machines to make the same part and I want to loop the entire program Loop included to check multiple parts at once.

    My question is, can you Loop a Loop?
    Or will the end point of the Loop checking multiple pockets cancel out the Loop that would be needed at the start of the program.
    Everyone needs something to Believe in ... I Believe I'll have another beer!

  • #2
    Simple answer is, yes you can loop a loop.

    I have done multiple loops before where I have measured a 4x3 grid of separate parts and that worked well. I havnt done a loop of parts with a loop of features in the middle of them but the theory is the same so should work.

    save the program, make a copy and give it a try is the best way.

    Comment


    • #3
      Since we brought up looping a loop. I was wondering if there was a simpler way on something related to this. Engineering has made me a fixture with 2 parts facing in X plus direction. and the other 2 in the X minus direction. Now the way I figure I will do this is, I will create a mirror program, and copy that into my existing program and put all the IF/END or GOTO commands in there that are needed or is there something I don't know about that will run the program mirrored?
      (In Memory of my Loving wife, "Ronda" who I lost March 7, 2016. I love you baby.)
      They say "Nobody's Perfect." I must be Nobody.

      Comment


      • #4
        Originally posted by KIRBSTER269 View Post
        Since we brought up looping a loop. I was wondering if there was a simpler way on something related to this. Engineering has made me a fixture with 2 parts facing in X plus direction. and the other 2 in the X minus direction. Now the way I figure I will do this is, I will create a mirror program, and copy that into my existing program and put all the IF/END or GOTO commands in there that are needed or is there something I don't know about that will run the program mirrored?
        When you create a mirrored program, it mirrors the code. There's nothing special inside the program, so you should be able to copy and paste as you would between other programs.

        You may be already aware, but it's not good to have features with the same name in the program, so when you copy and past, use paste with pattern. Set the number of times to 1 with no pattern. That will increment all the feature, alignment, and dimension names.
        PC-DMIS 2016.0 SP8

        Jeff

        Comment


        • KIRBSTER269
          KIRBSTER269 commented
          Editing a comment
          Well yeah, but I was wondering if there was an easy way to mirror without mirroring the program. So in short your saying NO, I assume? I guess my only other thought is to keep my dimensions called the same for all my information gets dumped in DataPage. Shut up VinniUSMC, I know that's not a question to ask in this part of the forum. Just thinking out loud.
          Last edited by KIRBSTER269; 01-13-2017, 12:19 PM.

      • #5
        I usually use loops, but I avoid inserting a loop inside another one, even if it's work well (because long time ago, it wasn't the case !!!!!)
        When I need to insert a loop in another one, I use while/end while in a loop or do/until, with a loop inside.
        I saw that do/until in a loop didn't work in 2014.1 (there's a thread about it)
        Happy week-end, all, it's friday !

        Comment


        • #6
          Originally posted by KIRBSTER269 View Post
          Since we brought up looping a loop. I was wondering if there was a simpler way on something related to this. Engineering has made me a fixture with 2 parts facing in X plus direction. and the other 2 in the X minus direction. Now the way I figure I will do this is, I will create a mirror program, and copy that into my existing program and put all the IF/END or GOTO commands in there that are needed or is there something I don't know about that will run the program mirrored?
          Curiosity kicked in. I make many loops at my company sometimes with up to 4 loops in 1 program, haven't had the opportunity to loop parts the I think you explained it, now I want to try it. Are the HEX parts setup the same way as yours?
          looper.png
          PcDmis 2015.1 SP10 CAD++
          Global 7-10-7 DC800S

          Comment


          • KIRBSTER269
            KIRBSTER269 commented
            Editing a comment
            As long as you mirror it in the right axis

        • #7
          1opp.jpg


          How mine looked and it worked fine. actually did not do a loop inside a loop, did 1 loop then another loop. a couple of my results are good but came out to negative numbers(I'll work on that later). Other than that it works beautiful.
          (In Memory of my Loving wife, "Ronda" who I lost March 7, 2016. I love you baby.)
          They say "Nobody's Perfect." I must be Nobody.

          Comment


          • #8
            Code:
                        IF_GOTO/C3.INPUT>=2,GOTO = CONTINUE
                        IF_GOTO/C3.INPUT==1,GOTO = END
            CONTINUE     =LABEL/
                     LOOP/END
                        IF_GOTO/C3.INPUT==2,GOTO = END
                        RECALL/ALIGNMENT,INTERNAL,3
            8          =ALIGNMENT/START,RECALL:3,LIST=YES
                          ALIGNMENT/TRANS_OFFSET,XAXIS,-83.11
                        ALIGNMENT/END
                        TIP/T1A-90B-90, SHANKIJK=-1, -0.007, 0.017, ANGLE=-90.548
            ALOOP_1    =LOOP/START,ID=YES,NUMBER=2,START=1,SKIP=,
                          OFFSET:XAXIS=0,YAXIS=50.8,ZAXIS=0,ANGLE=0
                          CLEARP/XMINUS,-7,XMINUS,0,ON
            This is what I do after the first loop. both loops are set at 2. At the beginning of program, I ask "How Many Parts Do You Want To Run?" C3.INPUT
            Code:
                      IF_GOTO/C3.INPUT==4,GOTO = CONTINUE_2
                      IF_GOTO/C3.INPUT==3,GOTO = END
            CONTINUE_2   =LABEL/
                     LOOP/END
            END        =LABEL/
            This is at the End of second loop
            Code:
            INCORRECT_INPUT=LABEL/
            C3         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                        How Many Parts Do You Want To Run?
                        IF_GOTO/C3.INPUT<1,GOTO = INCORRECT_INPUT
                        IF_GOTO/C3.INPUT>4,GOTO = INCORRECT_INPUT
            LOOP_1     =LOOP/START,ID=YES,NUMBER=2,START=1,SKIP=,
                          OFFSET:XAXIS=0,YAXIS=50.8,ZAXIS=0,ANGLE=0
            just to idiot proof it. since my fixture can only hold 4 pieces, any other number besides 1-4, wont work. This is at the beginning
            Last edited by KIRBSTER269; 01-19-2017, 11:55 AM.
            (In Memory of my Loving wife, "Ronda" who I lost March 7, 2016. I love you baby.)
            They say "Nobody's Perfect." I must be Nobody.

            Comment


            • KIRBSTER269
              KIRBSTER269 commented
              Editing a comment
              bigtallanddopey, yeah if you see the second code, you will see IF_GOTO/C3.INPUT==3, GOTO = END. That skips over the LOOP/END and goes to my END = LABEL. Sorry that can be confusing, I called my last LABEL, END
              Last edited by KIRBSTER269; 01-19-2017, 12:17 PM.

            • bigtallanddopey
              bigtallanddopey commented
              Editing a comment
              KIRBSTER269 ah I get it, would be a little more complicated for more parts but I am sure it is possible with some assignments and whatnot

            • KIRBSTER269
              KIRBSTER269 commented
              Editing a comment
              bigtallanddopey, same goes for one and 2 parts in first code. Your GOTO commands are just simply ON/OFF switches, If you give it a command and it matches your input, then it simply turns that command on. If it don't match, it ignores it. So if you entered 3 in the first CODE, The
              IF_GOTO/C3.INPUT>=2, GOTO = CONTINUE would turn on. This line turns on with 2,3,4 parts, the other 2 commands are ignored(unless its a 2, then the GOTO after the first LOOP/END turns on). gets to bottom and the one is turned on and the other is ignored
              Last edited by KIRBSTER269; 01-20-2017, 12:21 PM.

          • #9
            Oh and I'm sure a lot of you know this already, but I'll share anyways. Some of my results were coming negative
            positive.JPG
            check these in F5 and everything will come positive.
            (In Memory of my Loving wife, "Ronda" who I lost March 7, 2016. I love you baby.)
            They say "Nobody's Perfect." I must be Nobody.

            Comment

            Related Topics

            Collapse

            • DeWain Hodge
              Looping question
              by DeWain Hodge
              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....
              09-15-2016, 04:37 PM
            • WolfMan
              Yet another Looping thread
              by WolfMan
              I have not done this in a very long time, can someone suggest the best way to loop. I have 4 identical cylindrical parts that I want to measure in one...
              08-09-2017, 11:49 AM
            • bhska
              Looping Question?
              by bhska
              I have a program to check multiple features on these parts for inspection. I have looped 1-3 with one loop command that translates along X. My question...
              06-15-2006, 05:07 PM
            • kass_b
              itterative allignment
              by kass_b
              Running 3.7MR2 writting an iterative align to cad with loop runs the loop but wont write to program any help appreciated.
              05-19-2007, 10:03 AM
            • Kingkrab
              Attention Loop Masters
              by Kingkrab
              So I have 16 parts I need to measure in a 4 rows of 4 pattern. It's a simple 5 hole bolt pattern concentric to the I.D. Plane on the flange and level...
              10-10-2014, 07:10 AM
            Working...
            X