hexagon logo

learning looping.... I Want to just repeat program in the program?

So I have 100 small squares with 4 holes on the corners, I am set up to run 3 then the program ends.

I want to just replace the parts while the machine measures the last one, is this looping or a subroutine?

I will be getting 500 more tommorrow, and will likely measure 10 at a time instead.

any examples or point to previous thread appreciated!

Optivv 3 PCDMIS CAD 2011 MR1 Vision probe.

JoeSlight smile
Parents
  • This will do a 4x4 grid.

    You MUST have a constant spacing for each loop for it to work. You need the same spacing for X (inner loop) and the Y needs the same spacing (but doesn't have to match the X).

    Manual alignment of first part eliminated do to length constraints.
    ALIGN01    =ALIGNMENT/START,RECALL:STARTUP, LIST= YES
                ALIGNMENT/LEVEL,ZPLUS,TOP
                ALIGNMENT/ROTATE,XPLUS,TO,ROTLINE,ABOUT,ZPLUS
                ALIGNMENT/TRANS,XAXIS,H1
                ALIGNMENT/TRANS,YAXIS,H1
                ALIGNMENT/TRANS,ZAXIS,TOP
                ALIGNMENT/TRANS_OFFSET,XAXIS,0
                ALIGNMENT/TRANS_OFFSET,YAXIS,0
                ALIGNMENT/TRANS_OFFSET,ZAXIS,0
                ALIGNMENT/END
                MODE/DCC
                CLEARP/ZPLUS,20,ZPLUS,0
                MOVE/CLEARPLANE
    V2         =LOOP/START, ID = YES, NUMBER = 4, START = 1, SKIP = ,
                   OFFSET: XAXIS = 0, YAXIS = 200, ZAXIS = 0, ANGLE = 0
    V1         =LOOP/START, ID = YES, NUMBER = 4, START = 1, SKIP = ,
                   OFFSET: XAXIS = 200, YAXIS = 0, ZAXIS = 0, ANGLE = 0
    A1         =AUTO/VECTOR POINT,SHOWALLPARAMS = YES
                THEO/10.32,109.25,0,0,0,1
                ACTL/10.32,109.25,0,0,0,1
                TARG/10.32,109.25,0,0,0,1
                THEO_THICKNESS = 0,RECT,SNAP = YES,$
                AUTO MOVE = NO,DISTANCE = 125
                MOVE/CLEARPLANE
    A2         =AUTO/VECTOR POINT,SHOWALLPARAMS = YES
                THEO/4.95,16.88,0,0,0,1
                ACTL/4.95,16.88,0,0,0,1
                TARG/4.95,16.88,0,0,0,1
                THEO_THICKNESS = 0,RECT,SNAP = YES,$
                AUTO MOVE = NO,DISTANCE = 125
                MOVE/CLEARPLANE
    A3         =AUTO/VECTOR POINT,SHOWALLPARAMS = YES
                THEO/98.97,106.38,0,0,0,1
                ACTL/98.97,106.38,0,0,0,1
                TARG/98.97,106.38,0,0,0,1
                THEO_THICKNESS = 0,RECT,SNAP = YES,$
                AUTO MOVE = NO,DISTANCE = 125
                MOVE/CLEARPLANE
    A4         =AUTO/VECTOR POINT,SHOWALLPARAMS = YES
                THEO/98.97,106.37,0,0,0,1
                ACTL/98.97,106.37,0,0,0,1
                TARG/98.97,106.37,0,0,0,1
                THEO_THICKNESS = 0,RECT,SNAP = YES,$
                AUTO MOVE = NO,DISTANCE = 125
                MOVE/CLEARPLANE
    B1         =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
                THEO/0,0,0,0,0,1,7
                ACTL/0,0,0,0,0,1,7
                TARG/0,0,0,0,0,1
                THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,ONERROR = NO,$
                AUTO MOVE = NO,DISTANCE = 125,RMEAS = None,None,None,$
                READ POS = NO,FIND HOLE = NO,REMEASURE = NO,$
                NUMHITS = 4,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
                START ANG = 0,END ANG = 0,DEPTH = 3,$
                ANGLE VEC = 1,0,0
                MOVE/CLEARPLANE
    C1         =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
                THEO/110,0,0,0,0,1,7
                ACTL/110,0,0,0,0,1,7
                TARG/110,0,0,0,0,1
                THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,ONERROR = NO,$
                AUTO MOVE = NO,DISTANCE = 125,RMEAS = None,None,None,$
                READ POS = NO,FIND HOLE = NO,REMEASURE = NO,$
                NUMHITS = 4,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
                START ANG = 0,END ANG = 0,DEPTH = 3,$
                ANGLE VEC = 1,0,0
    ADATUM     =FEAT/PLANE,RECT,TRIANGLE
                THEO/53.303,84.72,0,0,0,1
                ACTL/53.303,84.72,0,0,0,1
                CONSTR/PLANE,BF,A1,A2,A3,A4,,
                OUTLIER_REMOVAL/OFF,3
                FILTER/OFF,WAVELENGTH=0
    BDATUM     =FEAT/LINE,RECT,UNBND
                THEO/0,0,0,1,0,0
                ACTL/0,0,0,1,0,0
                CONSTR/LINE,BF,2D,B1,C1,,
                OUTLIER_REMOVAL/OFF,3
                FILTER/OFF,WAVELENGTH=0
    ALIGN02    =ALIGNMENT/START,RECALL:ALIGN01, LIST= YES
                ALIGNMENT/LEVEL,ZPLUS,ADATUM
                ALIGNMENT/ROTATE,XPLUS,TO,BDATUM,ABOUT,ZPLUS
                ALIGNMENT/TRANS,XAXIS,B1
                ALIGNMENT/TRANS,YAXIS,B1
                ALIGNMENT/TRANS,ZAXIS,ADATUM
                ALIGNMENT/TRANS_OFFSET,XAXIS,0
                ALIGNMENT/TRANS_OFFSET,YAXIS,0
                ALIGNMENT/TRANS_OFFSET,ZAXIS,0
                ALIGNMENT/END
                MOVE/CLEARPLANE
    CIR1       =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
                THEO/0,0,0,0,0,1,7
                ACTL/0,0,0,0,0,1,7
                TARG/0,0,0,0,0,1
                THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,ONERROR = NO,$
                AUTO MOVE = NO,DISTANCE = 125,RMEAS = None,None,None,$
                READ POS = NO,FIND HOLE = NO,REMEASURE = NO,$
                NUMHITS = 4,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
                START ANG = 0,END ANG = 0,DEPTH = 3,$
                ANGLE VEC = 1,0,0
    DIM D001= LOCATION OF CIRCLE CIR1  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=1.00  OUTPUT=BOTH
    AX   NOMINAL     +TOL       -TOL       MEAS        DEV      OUTTOL   
    X       0.000      0.000      0.000      0.000      0.000      0.000 ----#----
    Y       0.000      0.000      0.000      0.000      0.000      0.000 ----#----
    D       7.000      0.000      0.000      7.000      0.000      0.000 ----#----
    END OF DIMENSION D001
                MOVE/CLEARPLANE
    CIR2       =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
                THEO/110,0,0,0,0,1,7
                ACTL/110,0,0,0,0,1,7
                TARG/110,0,0,0,0,1
                THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,ONERROR = NO,$
                AUTO MOVE = NO,DISTANCE = 125,RMEAS = None,None,None,$
                READ POS = NO,FIND HOLE = NO,REMEASURE = NO,$
                NUMHITS = 4,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
                START ANG = 0,END ANG = 0,DEPTH = 3,$
                ANGLE VEC = 1,0,0
    DIM D002= LOCATION OF CIRCLE CIR2  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=1.00  OUTPUT=BOTH
    AX   NOMINAL     +TOL       -TOL       MEAS        DEV      OUTTOL   
    X     110.000      0.000      0.000    110.000      0.000      0.000 ----#----
    Y       0.000      0.000      0.000      0.000      0.000      0.000 ----#----
    D       7.000      0.000      0.000      7.000      0.000      0.000 ----#----
    END OF DIMENSION D002
                MOVE/CLEARPLANE
    CIR3       =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
                THEO/0,110,0,0,0,1,7
                ACTL/0,110,0,0,0,1,7
                TARG/0,110,0,0,0,1
                THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,ONERROR = NO,$
                AUTO MOVE = NO,DISTANCE = 125,RMEAS = None,None,None,$
                READ POS = NO,FIND HOLE = NO,REMEASURE = NO,$
                NUMHITS = 4,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
                START ANG = 0,END ANG = 0,DEPTH = 3,$
                ANGLE VEC = 1,0,0
    DIM D003= LOCATION OF CIRCLE CIR3  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=1.00  OUTPUT=BOTH
    AX   NOMINAL     +TOL       -TOL       MEAS        DEV      OUTTOL   
    X       0.000      0.000      0.000      0.000      0.000      0.000 ----#----
    Y     110.000      0.000      0.000    110.000      0.000      0.000 ----#----
    D       7.000      0.000      0.000      7.000      0.000      0.000 ----#----
    END OF DIMENSION D003
                MOVE/CLEARPLANE
    CIR4       =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
                THEO/110,110,0,0,0,1,7
                ACTL/110,110,0,0,0,1,7
                TARG/110,110,0,0,0,1
                THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,ONERROR = NO,$
                AUTO MOVE = NO,DISTANCE = 125,RMEAS = None,None,None,$
                READ POS = NO,FIND HOLE = NO,REMEASURE = NO,$
                NUMHITS = 4,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
                START ANG = 0,END ANG = 0,DEPTH = 3,$
                ANGLE VEC = 1,0,0
    DIM D004= LOCATION OF CIRCLE CIR4  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=1.00  OUTPUT=BOTH
    AX   NOMINAL     +TOL       -TOL       MEAS        DEV      OUTTOL   
    X     110.000      0.000      0.000    110.000      0.000      0.000 ----#----
    Y     110.000      0.000      0.000    110.000      0.000      0.000 ----#----
    D       7.000      0.000      0.000      7.000      0.000      0.000 ----#----
    END OF DIMENSION D004
                LOOP/END
                LOOP/END
Reply
  • This will do a 4x4 grid.

    You MUST have a constant spacing for each loop for it to work. You need the same spacing for X (inner loop) and the Y needs the same spacing (but doesn't have to match the X).

    Manual alignment of first part eliminated do to length constraints.
    ALIGN01    =ALIGNMENT/START,RECALL:STARTUP, LIST= YES
                ALIGNMENT/LEVEL,ZPLUS,TOP
                ALIGNMENT/ROTATE,XPLUS,TO,ROTLINE,ABOUT,ZPLUS
                ALIGNMENT/TRANS,XAXIS,H1
                ALIGNMENT/TRANS,YAXIS,H1
                ALIGNMENT/TRANS,ZAXIS,TOP
                ALIGNMENT/TRANS_OFFSET,XAXIS,0
                ALIGNMENT/TRANS_OFFSET,YAXIS,0
                ALIGNMENT/TRANS_OFFSET,ZAXIS,0
                ALIGNMENT/END
                MODE/DCC
                CLEARP/ZPLUS,20,ZPLUS,0
                MOVE/CLEARPLANE
    V2         =LOOP/START, ID = YES, NUMBER = 4, START = 1, SKIP = ,
                   OFFSET: XAXIS = 0, YAXIS = 200, ZAXIS = 0, ANGLE = 0
    V1         =LOOP/START, ID = YES, NUMBER = 4, START = 1, SKIP = ,
                   OFFSET: XAXIS = 200, YAXIS = 0, ZAXIS = 0, ANGLE = 0
    A1         =AUTO/VECTOR POINT,SHOWALLPARAMS = YES
                THEO/10.32,109.25,0,0,0,1
                ACTL/10.32,109.25,0,0,0,1
                TARG/10.32,109.25,0,0,0,1
                THEO_THICKNESS = 0,RECT,SNAP = YES,$
                AUTO MOVE = NO,DISTANCE = 125
                MOVE/CLEARPLANE
    A2         =AUTO/VECTOR POINT,SHOWALLPARAMS = YES
                THEO/4.95,16.88,0,0,0,1
                ACTL/4.95,16.88,0,0,0,1
                TARG/4.95,16.88,0,0,0,1
                THEO_THICKNESS = 0,RECT,SNAP = YES,$
                AUTO MOVE = NO,DISTANCE = 125
                MOVE/CLEARPLANE
    A3         =AUTO/VECTOR POINT,SHOWALLPARAMS = YES
                THEO/98.97,106.38,0,0,0,1
                ACTL/98.97,106.38,0,0,0,1
                TARG/98.97,106.38,0,0,0,1
                THEO_THICKNESS = 0,RECT,SNAP = YES,$
                AUTO MOVE = NO,DISTANCE = 125
                MOVE/CLEARPLANE
    A4         =AUTO/VECTOR POINT,SHOWALLPARAMS = YES
                THEO/98.97,106.37,0,0,0,1
                ACTL/98.97,106.37,0,0,0,1
                TARG/98.97,106.37,0,0,0,1
                THEO_THICKNESS = 0,RECT,SNAP = YES,$
                AUTO MOVE = NO,DISTANCE = 125
                MOVE/CLEARPLANE
    B1         =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
                THEO/0,0,0,0,0,1,7
                ACTL/0,0,0,0,0,1,7
                TARG/0,0,0,0,0,1
                THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,ONERROR = NO,$
                AUTO MOVE = NO,DISTANCE = 125,RMEAS = None,None,None,$
                READ POS = NO,FIND HOLE = NO,REMEASURE = NO,$
                NUMHITS = 4,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
                START ANG = 0,END ANG = 0,DEPTH = 3,$
                ANGLE VEC = 1,0,0
                MOVE/CLEARPLANE
    C1         =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
                THEO/110,0,0,0,0,1,7
                ACTL/110,0,0,0,0,1,7
                TARG/110,0,0,0,0,1
                THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,ONERROR = NO,$
                AUTO MOVE = NO,DISTANCE = 125,RMEAS = None,None,None,$
                READ POS = NO,FIND HOLE = NO,REMEASURE = NO,$
                NUMHITS = 4,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
                START ANG = 0,END ANG = 0,DEPTH = 3,$
                ANGLE VEC = 1,0,0
    ADATUM     =FEAT/PLANE,RECT,TRIANGLE
                THEO/53.303,84.72,0,0,0,1
                ACTL/53.303,84.72,0,0,0,1
                CONSTR/PLANE,BF,A1,A2,A3,A4,,
                OUTLIER_REMOVAL/OFF,3
                FILTER/OFF,WAVELENGTH=0
    BDATUM     =FEAT/LINE,RECT,UNBND
                THEO/0,0,0,1,0,0
                ACTL/0,0,0,1,0,0
                CONSTR/LINE,BF,2D,B1,C1,,
                OUTLIER_REMOVAL/OFF,3
                FILTER/OFF,WAVELENGTH=0
    ALIGN02    =ALIGNMENT/START,RECALL:ALIGN01, LIST= YES
                ALIGNMENT/LEVEL,ZPLUS,ADATUM
                ALIGNMENT/ROTATE,XPLUS,TO,BDATUM,ABOUT,ZPLUS
                ALIGNMENT/TRANS,XAXIS,B1
                ALIGNMENT/TRANS,YAXIS,B1
                ALIGNMENT/TRANS,ZAXIS,ADATUM
                ALIGNMENT/TRANS_OFFSET,XAXIS,0
                ALIGNMENT/TRANS_OFFSET,YAXIS,0
                ALIGNMENT/TRANS_OFFSET,ZAXIS,0
                ALIGNMENT/END
                MOVE/CLEARPLANE
    CIR1       =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
                THEO/0,0,0,0,0,1,7
                ACTL/0,0,0,0,0,1,7
                TARG/0,0,0,0,0,1
                THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,ONERROR = NO,$
                AUTO MOVE = NO,DISTANCE = 125,RMEAS = None,None,None,$
                READ POS = NO,FIND HOLE = NO,REMEASURE = NO,$
                NUMHITS = 4,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
                START ANG = 0,END ANG = 0,DEPTH = 3,$
                ANGLE VEC = 1,0,0
    DIM D001= LOCATION OF CIRCLE CIR1  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=1.00  OUTPUT=BOTH
    AX   NOMINAL     +TOL       -TOL       MEAS        DEV      OUTTOL   
    X       0.000      0.000      0.000      0.000      0.000      0.000 ----#----
    Y       0.000      0.000      0.000      0.000      0.000      0.000 ----#----
    D       7.000      0.000      0.000      7.000      0.000      0.000 ----#----
    END OF DIMENSION D001
                MOVE/CLEARPLANE
    CIR2       =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
                THEO/110,0,0,0,0,1,7
                ACTL/110,0,0,0,0,1,7
                TARG/110,0,0,0,0,1
                THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,ONERROR = NO,$
                AUTO MOVE = NO,DISTANCE = 125,RMEAS = None,None,None,$
                READ POS = NO,FIND HOLE = NO,REMEASURE = NO,$
                NUMHITS = 4,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
                START ANG = 0,END ANG = 0,DEPTH = 3,$
                ANGLE VEC = 1,0,0
    DIM D002= LOCATION OF CIRCLE CIR2  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=1.00  OUTPUT=BOTH
    AX   NOMINAL     +TOL       -TOL       MEAS        DEV      OUTTOL   
    X     110.000      0.000      0.000    110.000      0.000      0.000 ----#----
    Y       0.000      0.000      0.000      0.000      0.000      0.000 ----#----
    D       7.000      0.000      0.000      7.000      0.000      0.000 ----#----
    END OF DIMENSION D002
                MOVE/CLEARPLANE
    CIR3       =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
                THEO/0,110,0,0,0,1,7
                ACTL/0,110,0,0,0,1,7
                TARG/0,110,0,0,0,1
                THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,ONERROR = NO,$
                AUTO MOVE = NO,DISTANCE = 125,RMEAS = None,None,None,$
                READ POS = NO,FIND HOLE = NO,REMEASURE = NO,$
                NUMHITS = 4,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
                START ANG = 0,END ANG = 0,DEPTH = 3,$
                ANGLE VEC = 1,0,0
    DIM D003= LOCATION OF CIRCLE CIR3  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=1.00  OUTPUT=BOTH
    AX   NOMINAL     +TOL       -TOL       MEAS        DEV      OUTTOL   
    X       0.000      0.000      0.000      0.000      0.000      0.000 ----#----
    Y     110.000      0.000      0.000    110.000      0.000      0.000 ----#----
    D       7.000      0.000      0.000      7.000      0.000      0.000 ----#----
    END OF DIMENSION D003
                MOVE/CLEARPLANE
    CIR4       =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
                THEO/110,110,0,0,0,1,7
                ACTL/110,110,0,0,0,1,7
                TARG/110,110,0,0,0,1
                THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,ONERROR = NO,$
                AUTO MOVE = NO,DISTANCE = 125,RMEAS = None,None,None,$
                READ POS = NO,FIND HOLE = NO,REMEASURE = NO,$
                NUMHITS = 4,INIT = 0,PERM = 0,SPACER = 3,PITCH = 0,$
                START ANG = 0,END ANG = 0,DEPTH = 3,$
                ANGLE VEC = 1,0,0
    DIM D004= LOCATION OF CIRCLE CIR4  UNITS=MM ,$
    GRAPH=OFF  TEXT=OFF  MULT=1.00  OUTPUT=BOTH
    AX   NOMINAL     +TOL       -TOL       MEAS        DEV      OUTTOL   
    X     110.000      0.000      0.000    110.000      0.000      0.000 ----#----
    Y     110.000      0.000      0.000    110.000      0.000      0.000 ----#----
    D       7.000      0.000      0.000      7.000      0.000      0.000 ----#----
    END OF DIMENSION D004
                LOOP/END
                LOOP/END
Children
No Data