Im currently writing a program to inspect 4 parts on a fixture. Im looking for some help with creating a loop that has multiple alignments to reference to, but only loops 1 measurement routine (hole locations, planes, etc) and updates those theoretical locations based on which part is being measured. I have a input comment to the operator to say how many parts are being inspected, and made an assignment to that value. That value is then driving how many times the loop will cycle through. I just cant figure out how to make different alignments active, and update the features theoretical values.
Im not very far along in trying to get this to work... Disregard the last circle, as i was going to attempt to get that circle to loop to the 4 parts after i define the 4 separate alignments. Aside from that - hopefully the code is helpful, see below:
C2 =COMMENT/INPUT,NO,FULL SCREEN=NO,
How many parts will be inspected? (Populate stations 1, 2, 3, and 4 in ascending order)
ASSIGN/V1=C2.INPUT
MODE/DCC
MOVE/POINT,NORMAL,<0,0,10>
TIP/TIP5, SHANKIJK=0, 1, 0, ANGLE=0
STATION 1 A DATUM=FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,NONE,LEAST_SQR
THEO/<-2.8309,-1.4295,3.1196>,<0,1,0>
ACTL/<-2.8309,-1.4492,3.1195>,<-0.0005285,0.9999991,0.0012164>
TARG/<-2.8309,-1.4295,3.1196>,<0,1,0>
ANGLE VEC=<-1,0,0>,SQUARE
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=YES
NUMHITS=4,NUMROWS=5
SPACER=0
AVOIDANCE MOVE=BOTH,DISTANCE BEFORE=0.3937,DISTANCE AFTER=0.3937
USE BOUNDARY OFFSET=YES,OFFSET=0.0625
SHOW HITS=NO
TIP/TIP2, SHANKIJK=-1, 0, 0, ANGLE=0
MOVE/POINT,NORMAL,<-3.5,0,4>
MOVE/POINT,NORMAL,<-3.5,-1.75,4>
STATION 1 C DATUM LEFT=GROUP/SHOWALLPARAMS=NO
ENDGROUP/ID=STATION 1 C DATUM LEFT
STATION 1 C DATUM LEFT PLANE=FEAT/PLANE,CARTESIAN,TRIANGLE,NO,LEAST_SQR
THEO/<-2.475,-1.8713,2.8962>,<-1,0,0>
ACTL/<-2.4698,-1.8712,2.8961>,<-0.9999984,-0.0016009,0.0008006>
CONSTR/PLANE,BFRE,PNT2,PNT3,PNT4,PNT5,PNT6,PNT7,PNT8,PNT9,PNT10,PNT11,PNT12,PNT13,PNT14,,
OUTLIER_REMOVAL/OFF,3
FILTER/OFF,WAVELENGTH=0
MOVE/POINT,NORMAL,<-2.875,-2.125,4.625>
TIP/TIP4, SHANKIJK=1, 0, 0, ANGLE=0
MOVE/POINT,NORMAL,<-1.25,-2.125,4.625>
STATION 1 C DATUM RIGHT=GROUP/SHOWALLPARAMS=NO
ENDGROUP/ID=STATION 1 C DATUM RIGHT
STATION 1 C DATUM RIGHT PLANE=FEAT/PLANE,CARTESIAN,TRIANGLE,NO,LEAST_SQR
THEO/<-1.585,-1.8198,2.9006>,<1,0,0>
ACTL/<-1.5803,-1.8199,2.9006>,<0.9999982,0.001846,-0.0004031>
CONSTR/PLANE,BFRE,PNT15,PNT16,PNT17,PNT18,PNT19,PNT20,PNT21,PNT22,PNT23,PNT24,PNT25,PNT26,PNT27,,
OUTLIER_REMOVAL/OFF,3
FILTER/OFF,WAVELENGTH=0
STATION 1 C DATUM=FEAT/PLANE,CARTESIAN,TRIANGLE,NO
THEO/<-2.03,-1.8456,2.8984>,<-1,0,0>
ACTL/<-2.025,-1.8456,2.8984>,<-0.9999983,-0.0017235,0.0006019>
CONSTR/PLANE,MID,STATION 1 C DATUM LEFT PLANE,STATION 1 C DATUM RIGHT PLANE
MOVE/INCREMENT,<0,0,3.5>
TIP/TIP1, SHANKIJK=0, 0, 1, ANGLE=0
STATION 1 B DATUM=GROUP/SHOWALLPARAMS=NO
ENDGROUP/ID=STATION 1 B DATUM
STATION 1 B DATUM PLANE=FEAT/PLANE,CARTESIAN,TRIANGLE,NO,LEAST_SQR
THEO/<-2.0306,-1.5393,4.345>,<0,0,1>
ACTL/<-2.0306,-1.5392,4.3538>,<0.0010918,-0.0019127,0.9999976>
CONSTR/PLANE,BFRE,PNT28,PNT29,PNT30,PNT31,PNT32,PNT33,,
OUTLIER_REMOVAL/OFF,3
FILTER/OFF,WAVELENGTH=0
DATDEF/S1A,FEATURES=STATION 1 A DATUM,,
DATDEF/S1B,FEATURES=STATION 1 B DATUM PLANE,,
DATDEF/S1C,FEATURES=STATION 1 C DATUM,,
STATION 1 ALIGNMENT=ALIGNMENT/START,RECALL:STARTUP,LIST=YES
ALIGNMENT/LEVEL,YPLUS,STATION 1 A DATUM
ALIGNMENT/TRANS,YAXIS,STATION 1 A DATUM
ALIGNMENT/ROTATE,ZPLUS,TO,STATION 1 B DATUM PLANE,ABOUT,YPLUS
ALIGNMENT/TRANS,ZAXIS,STATION 1 B DATUM PLANE
ALIGNMENT/TRANS,XAXIS,STATION 1 C DATUM
ALIGNMENT/END
V2 =LOOP/START,ID=YES,NUMBER=V1,START=1,SKIP=,
OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
TIP/TIP5, SHANKIJK=0.0005, 1, -0.0012, ANGLE=-0.0628
MOVE/INCREMENT,<0,1.5,0>
CIR1 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
THEO/<-0.87,0,-0.325>,<0,1,0>,0.221
ACTL/<-0.8697,0,-0.3249>,<0,1,0>,0.2212
TARG/<-0.87,0,-0.325>,<0,1,0>
START ANG=0,END ANG=0
ANGLE VEC=<-1,0,0>
DIRECTION=CCW
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=YES
NUMHITS=5,DEPTH=-0.04,PITCH=0
SAMPLE METHOD=SAMPLE_HITS
SAMPLE HITS=0,SPACER=0
AVOIDANCE MOVE=BOTH,DISTANCE BEFORE=0.3937,DISTANCE AFTER=0.3937
FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
SHOW HITS=NO
LOOP/END
The 4 parts dont move the same distance each time the loop needs to repeat. Currently the fixture layout would start at the first parts alignment, then the next alignment (part 2) coordinate deviation would be x 0, y 4.75, z 0. Then after that, the 3rd part alignment would go from the 2nd part to x 4.06, y 0, z zero. 4th part alignment would go from part 3 x 0, y -4.75, z 0. Hope all that gibberish makes a little sense
Im not very far along in trying to get this to work... Disregard the last circle, as i was going to attempt to get that circle to loop to the 4 parts after i define the 4 separate alignments. Aside from that - hopefully the code is helpful, see below:
C2 =COMMENT/INPUT,NO,FULL SCREEN=NO,
How many parts will be inspected? (Populate stations 1, 2, 3, and 4 in ascending order)
ASSIGN/V1=C2.INPUT
MODE/DCC
MOVE/POINT,NORMAL,<0,0,10>
TIP/TIP5, SHANKIJK=0, 1, 0, ANGLE=0
STATION 1 A DATUM=FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,NONE,LEAST_SQR
THEO/<-2.8309,-1.4295,3.1196>,<0,1,0>
ACTL/<-2.8309,-1.4492,3.1195>,<-0.0005285,0.9999991,0.0012164>
TARG/<-2.8309,-1.4295,3.1196>,<0,1,0>
ANGLE VEC=<-1,0,0>,SQUARE
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=YES
NUMHITS=4,NUMROWS=5
SPACER=0
AVOIDANCE MOVE=BOTH,DISTANCE BEFORE=0.3937,DISTANCE AFTER=0.3937
USE BOUNDARY OFFSET=YES,OFFSET=0.0625
SHOW HITS=NO
TIP/TIP2, SHANKIJK=-1, 0, 0, ANGLE=0
MOVE/POINT,NORMAL,<-3.5,0,4>
MOVE/POINT,NORMAL,<-3.5,-1.75,4>
STATION 1 C DATUM LEFT=GROUP/SHOWALLPARAMS=NO
ENDGROUP/ID=STATION 1 C DATUM LEFT
STATION 1 C DATUM LEFT PLANE=FEAT/PLANE,CARTESIAN,TRIANGLE,NO,LEAST_SQR
THEO/<-2.475,-1.8713,2.8962>,<-1,0,0>
ACTL/<-2.4698,-1.8712,2.8961>,<-0.9999984,-0.0016009,0.0008006>
CONSTR/PLANE,BFRE,PNT2,PNT3,PNT4,PNT5,PNT6,PNT7,PNT8,PNT9,PNT10,PNT11,PNT12,PNT13,PNT14,,
OUTLIER_REMOVAL/OFF,3
FILTER/OFF,WAVELENGTH=0
MOVE/POINT,NORMAL,<-2.875,-2.125,4.625>
TIP/TIP4, SHANKIJK=1, 0, 0, ANGLE=0
MOVE/POINT,NORMAL,<-1.25,-2.125,4.625>
STATION 1 C DATUM RIGHT=GROUP/SHOWALLPARAMS=NO
ENDGROUP/ID=STATION 1 C DATUM RIGHT
STATION 1 C DATUM RIGHT PLANE=FEAT/PLANE,CARTESIAN,TRIANGLE,NO,LEAST_SQR
THEO/<-1.585,-1.8198,2.9006>,<1,0,0>
ACTL/<-1.5803,-1.8199,2.9006>,<0.9999982,0.001846,-0.0004031>
CONSTR/PLANE,BFRE,PNT15,PNT16,PNT17,PNT18,PNT19,PNT20,PNT21,PNT22,PNT23,PNT24,PNT25,PNT26,PNT27,,
OUTLIER_REMOVAL/OFF,3
FILTER/OFF,WAVELENGTH=0
STATION 1 C DATUM=FEAT/PLANE,CARTESIAN,TRIANGLE,NO
THEO/<-2.03,-1.8456,2.8984>,<-1,0,0>
ACTL/<-2.025,-1.8456,2.8984>,<-0.9999983,-0.0017235,0.0006019>
CONSTR/PLANE,MID,STATION 1 C DATUM LEFT PLANE,STATION 1 C DATUM RIGHT PLANE
MOVE/INCREMENT,<0,0,3.5>
TIP/TIP1, SHANKIJK=0, 0, 1, ANGLE=0
STATION 1 B DATUM=GROUP/SHOWALLPARAMS=NO
ENDGROUP/ID=STATION 1 B DATUM
STATION 1 B DATUM PLANE=FEAT/PLANE,CARTESIAN,TRIANGLE,NO,LEAST_SQR
THEO/<-2.0306,-1.5393,4.345>,<0,0,1>
ACTL/<-2.0306,-1.5392,4.3538>,<0.0010918,-0.0019127,0.9999976>
CONSTR/PLANE,BFRE,PNT28,PNT29,PNT30,PNT31,PNT32,PNT33,,
OUTLIER_REMOVAL/OFF,3
FILTER/OFF,WAVELENGTH=0
DATDEF/S1A,FEATURES=STATION 1 A DATUM,,
DATDEF/S1B,FEATURES=STATION 1 B DATUM PLANE,,
DATDEF/S1C,FEATURES=STATION 1 C DATUM,,
STATION 1 ALIGNMENT=ALIGNMENT/START,RECALL:STARTUP,LIST=YES
ALIGNMENT/LEVEL,YPLUS,STATION 1 A DATUM
ALIGNMENT/TRANS,YAXIS,STATION 1 A DATUM
ALIGNMENT/ROTATE,ZPLUS,TO,STATION 1 B DATUM PLANE,ABOUT,YPLUS
ALIGNMENT/TRANS,ZAXIS,STATION 1 B DATUM PLANE
ALIGNMENT/TRANS,XAXIS,STATION 1 C DATUM
ALIGNMENT/END
V2 =LOOP/START,ID=YES,NUMBER=V1,START=1,SKIP=,
OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
TIP/TIP5, SHANKIJK=0.0005, 1, -0.0012, ANGLE=-0.0628
MOVE/INCREMENT,<0,1.5,0>
CIR1 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
THEO/<-0.87,0,-0.325>,<0,1,0>,0.221
ACTL/<-0.8697,0,-0.3249>,<0,1,0>,0.2212
TARG/<-0.87,0,-0.325>,<0,1,0>
START ANG=0,END ANG=0
ANGLE VEC=<-1,0,0>
DIRECTION=CCW
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=YES
NUMHITS=5,DEPTH=-0.04,PITCH=0
SAMPLE METHOD=SAMPLE_HITS
SAMPLE HITS=0,SPACER=0
AVOIDANCE MOVE=BOTH,DISTANCE BEFORE=0.3937,DISTANCE AFTER=0.3937
FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
SHOW HITS=NO
LOOP/END
The 4 parts dont move the same distance each time the loop needs to repeat. Currently the fixture layout would start at the first parts alignment, then the next alignment (part 2) coordinate deviation would be x 0, y 4.75, z 0. Then after that, the 3rd part alignment would go from the 2nd part to x 4.06, y 0, z zero. 4th part alignment would go from part 3 x 0, y -4.75, z 0. Hope all that gibberish makes a little sense