Looping issues...

  • Time
  • Show
Clear All
new posts

  • Looping issues...

    Wanted to know if anyone could help with this:

    (PC-DMIS 3.7 MR3)

    I have a fixture that is holding three parts. I can write the program to inspect all three parts, or I can write the program to inspect one part and then loop that program twice to get the next two. The problem I encounter is that the next two parts are not offset by the same dimensions and angle. So I cannot use the same loop command for all three parts because they are not spaced the same on the fixture. The second part is offset from the first by 3.500, 3.160, 0, 180degrees. The thrid part is offset from the first by -8.520, 0.906, 0, 270degrees.

    I tried to run two loops, one with the first offset, the other with the second offset. But the program wants to inspect the first two only, or the first and third only, or all three and than a fourth that doesn't exist. I cannot get it to do the three parts and then stop.

    Can anyone assist me with how I should configure the loop command?


  • #2
    Well, you could do 3 alignments, one for each position in the fixture, then have the loop call up the correct (external) alignment for that position.
    Originally posted by AndersI
    I've got one from September 2006 (bug ticket) which has finally been fixed in 2013.


    • #3
      I've never tried this so it may not work perhaps someone else has experience with this. Perhaps you could (if posible) nest a loop inside your loop and use the nested loop to set a variable that you would use as your offset value.
      <internet bumper sticker goes here>


      • #4
        what matt said, yea thats the ticket
        Links to my utilities for PCDMIS


        • #5
          I did try the "nested loop" idea. I had a loop inside the first loop. I played around with the start number, end number. But I couldn't get the loops to work in the correct order, or the correct number of times. It would only do the first two, or the first and the third, or it wanted to do more than 3.


          • #6
            make sure that you loops are nested correctly.

            post just the loop code...
            Links to my utilities for PCDMIS


            • #7
              Could you copy and paste with pattern 2 times for the differing offsets?
              B&S Mistral
              3.207 Beta on XP

              Older'n dirt


              • #8
                you could copy / paste the features but would be hard to debug. I would do what matt said.
                I used to be high on life but I built up a tolerance.

                Brown & Sharpe Global Advantage
                PCDMIS CAD++ v2011mr2



                • #9
                  Here is the loop code:

                  V1 =LOOP/START, ID = YES, NUMBER = 2, START = 1, SKIP = ,
                  OFFSET: XAXIS = 3.5002, YAXIS = 3.1605, ZAXIS = 0, ANGLE = 180
                  V2 =LOOP/START, ID = YES, NUMBER = 1, START = 1, SKIP = ,
                  OFFSET: XAXIS = -8.542, YAXIS = 0.9062, ZAXIS = 0, ANGLE = 270


                  • #10
                    You could make the offsets variables and have the variable dependant upon the loop count. I loop # this then offset that.

                    Haven't done this in PCDMIS yet but if it can be done in MM4 I'm sure you can do it with PCDMIS.

                    sigpicHave a homebrew


                    • #11
                      what order are the end loops in? I forget does pcdmis care?
                      Links to my utilities for PCDMIS


                      • #12
                        Guys, here is an update as to my looping issues. And to why this is a problem for me:

                        I have a fixture that holds three parts. They are not offset by the same distances, or angle. There are 5 dimensions on each part that I am sending to my SPC software (SPC Light). When PC-DMIS saves these 5 dimensions from the 3 parts, it saves them as 15 different variables, and that is how my SPC software reads it in the XSTATS11.tmp file. This is the problem. I want it to be read as 3 samples of 5 dimensions so that it will be saved as a subgroup of three parts. I have tried to name the dimensions the same name, but PC-DMIS says they “must be unique” names.

                        Is there a certain way that I must name them? Or is there a way to tell PC-DMIS that these are the same variables, and not 15 different variables?

                        I have found a way to use the loop command to inspect the parts. This will save the dimensions correctly for my SPC software to read them. But my parts are offset by different distances, and angle. The loop only allows me to enter in 1 offset. When I nest my loops, the naming of the dimensions messes up how SPC Light reads them. I think that the only way it will work is with 1 loop, not 2. This takes me back to the "nameing" problem.

                        I am getting frustrated with this. Any ideas or insight would be helpful



                        • #13
                          I have no experience with looping of the type you need, but I do have a suggestion. Seeing as you have 3.7MR3 can I assume that you also have an SMA? If so this is the perfect time to utilize the SMA. That is what the Application Engineers are there for. Just a thought.

                          James Mannes


                          • #14
                            I'd go with Matt Hoedeman's recommendation of flow control. I would not have recommended looping if I had known I'd put you through this. Sorry man, but I think Matt's idea should work well for you. I'll see if I can write up a code snip of what Matt is talking about in case you need ideas (if I get some extra time today).

                            <internet bumper sticker goes here>


                            • #15
                              Loop alternative

                              Loops are great for simple repetition. Once I want to go beyond that, and avoid the implications that PC-DMIS offers, I write my own logic in may cases. Here is an example (pseudocode) of what I mean -

                              Initial alignment
                              Save Alignment externally => A1

                              Label => L1
                              Recall alignment A1
                              measure features
                              move alignment (translate, rotate, etc)
                              Save alignment => A1
                              Go to Label L1

                              So you see, every time it branches back to the Label again, it recalls the alignment of the same name. BUT, what is inside the alignment is different every time.

                              In your case, you can do your translation and rotation (based on variables) at the end of each cycle, and save it again to the extgernal alignment file. When it branches back up, it knows where the next part is, and runs the same measurement process.

                              As I said, I've used this sort of operation many times, and it never fails me.


                              Related Topics