hexagon logo

Looping

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 and is the easiest explanation I have seen to date...
I am doing a part program myself that will run multiple parts(8), I have gotten some help from criager_ny for this and here is the body of our conversation...
"OK here is an introduction to looping. Below I have nested 2 loops. This is all based on the assumption that each station on the fixture is spaced evenly. If it is not we can still do it but it will just take a little finessing. Loops have a default name that you can edit in my case I named one Y_LOOP and the other X_LOOP. Supposedly that name is a variable that counts the iterations so on the first run through the variable X_LOOP can be referenced and would show a value of 1, the second time around it would increment to 2 and so on. That would make a nice counter but I have yet to see it work on my versions. So when I need a counter I make my own by declaring a variable before the loop to equal 1 and at the end of the loop I add 1 to that variable then reference it.

The NUMBER field is the number of times you want it to loop. I never use skip but you can actually have it skip every so many loops if you wish. In the offset area you’ll see each axis as well as an angle. What ever value you put in it offsets your origin that much. In my example I use 1 so I am saying to PCDMIS every time you execute move over in the X axis 1 inch before the next loop. this is where clearplanes will save your ass. Use a clear plane on your first feature so that you’ll clear the fixture/part when going from station to station.
In my example I measure a 0.9 diameter ID then I move over 1 inch in the X axis and measure another, then I move over another inch and do it again a total of 4 times. Then it goes all the way back to the beginning except it moves 1 inch in the Y axis and runs the part 4 more times each time moving over 1 inch in the X axis just like before. After that it exits the loop.
It is pretty simple really. It enters the first loop called Y_LOOP, then it enters the second loop called X_LOOP and loops 4 times. You are looping a loop. The first loop is the Y_LOOP but it has to wait until the X_LOOP is done before it increments.
The same can be done with an angle instead of a distance. Basically you’d be looping polar. Let me know if this is enough to get you started or if you need more.
Craig"
Y_LOOP =LOOP/START, ID = YES, NUMBER = 2, START = 1, SKIP = ,
OFFSET: XAXIS = 0, YAXIS = 1, ZAXIS = 0, ANGLE = 0
X_LOOP =LOOP/START, ID = YES, NUMBER = 4, START = 1, SKIP = ,
OFFSET: XAXIS = 1, YAXIS = 0, ZAXIS = 0, ANGLE = 0
CIR2 =FEAT/CIRCLE,RECT,IN,LEAST_SQR
THEO/0,0,-0.2,0,0,1,0.9
ACTL/-0.0112,-0.0186,-0.199,0,0,1,0.9065
MEAS/CIRCLE,6,WORKPLANE
MOVE/CLEARPLANE
HIT/BASIC,0.45,0,-0.2,-1,0,0,0.4419,-0.0012,-0.1988
HIT/BASIC,0.225,0.3897,-0.2,-0.5,-0.8660254,0,0.2156,0.3737,-0.1988
HIT/BASIC,-0.225,0.3897,-0.2,0.5,-0.8660254,0,-0.2213,0.3832,-0.1989
HIT/BASIC,-0.45,0,-0.2,1,0,0,-0.4637,0.0012,-0.1991
HIT/BASIC,-0.225,-0.3897,-0.2,0.5,0.8660254,0,-0.2376,-0.4114,-0.1991
HIT/BASIC,0.225,-0.3897,-0.2,-0.5,0.8660254,0,0.2316,-0.4011,-0.199
ENDMEAS/
LOOP/END
LOOP/END