Nested Loops in PC-DMIS | PC-DMIS Tech Tips - CMMXYZ

Поділитися
Вставка
  • Опубліковано 12 лис 2024
  • This PC-DMIS Tech Tip from CMMXYZ will teach you how to create a loop within a loop. Nested loops are often used in running multiple parts on a fixture.
    Hey, so in this video, I took a page from our level three training book on loops to show you how to create what's called a nested loop. So this is otherwise known as a loop within a loop. So my goal with this loop is to create a program on only one part and have it looped in such a way that it will measure all eight parts in the order that I want. So what I have is two rows. So I want to run the loop so that it measures row one. When it finishes row one, it'll go over to row two, and start the process all over again. Okay, so let's open PC-DMIS and I'll show you how it's done.
    Okay, so here we are in PC-DMIS. I have my one program written. I'll just run it to show you what it is. Okay, so that's my complete program start to finish, including two tip angles, my alignment features and my measured features. So what I need to do now is to loop in two different ways, with two different offsets, I should say. So let's go ahead and start. So let's go to the beginning of the program. I'll start by placing my cursor before the first feature. So we've selected our probe, we've selected our tip angle, and then we're just gonna go ahead and loop from this point. So this is important in looping, you need to select your start point very carefully. Okay, so from the menu, we'll go to Insert, Flow Control Command and Looping.
    So the first thing we need to do is decide how many times to loop. In our example, we're dealing with the first loop that will be inside the nest, loop one, so that will be three parts. So this is the the left-hand column, start at one, finish at three. So next we have to say, or tell the software what the offset is. In my case, it's 100 millimeters. So that's it. So we'll click okay. And you'll notice that I have the red lettering, which means there's some sort of a syntax error in my code. So there's a problem there. So that's expected. And this always happens when you start a loop. The error in this case is that my loop has no end. So I need a LOOP/START and a LOOP/END. In our case, the LOOP/END is just the end of the program. So I'll put my cursor at the end, back to the menu, Insert, Flow Control Command, and we simply select End Loop. So that's it. So you'll notice also that our code has been indented a bit to indicate that this is all part of a loop. So let's go back to the beginning. And also notice that the red lettering is gone.
    So I'm actually gonna rename this feature. So we'll call it loop one. And just delete the rest there. So this will help me explain it and how to stay organized. So as it is now if I ran this as a loop, it would just measure the three parts with a 100-millimeter offset. So that's my Y offset. So the next thing is I need to do the second loop. And it's kind of strange, that second loop in the code actually comes first. But that's just the way it works. So let's do our second loop. Insert, Flow Control Command and Looping. Okay, so this time my end number is actually 2. So this is just the second row. So moving over to the right, with an X axis offset of, in this case, 150 millimeters. And we'll just say okay to that. And again, we have the red indicating that there's an error. So we actually have to do a second loop end. So we had to really keep track of all the LOOP/STARTS and the LOOP/END. So we'll just do the second one and you'll see a second indent. So now I have a loop inside of a loop, which is actually in this case, loop 2. So when PC-DMIS encounters the loops, it will go to the inside loop first, complete that with the 100-millimeter Y offset, and when it's finished, and it reaches the end of the loop for the third iteration, right here, it will go from this point up to the top and go to the outside loop which is loop 2. That's the X axis offset this case of 150 millimeters.
    About CMMXYZ
    We are North America's foremost independent measurement solutions provider. We sell new and used coordinate measuring machines, provide measuring services, upgrade and repair your systems.
    CMMXYZ - Coordinate Measuring Machines - www.cmmxyz.com/
    Get the latest on Twitter - / cmmxyz
    Follow CMMXYZ on LinkedIn - / cmmxyz
    Learn more about CMMXYZ on our blog - blog.cmmxyz.co...
    Subscribe to our UA-cam Channel - / cmmxyzvideo

КОМЕНТАРІ •