hexagon logo

Looping question: Unique Input for Each Part plus Skipping Stations

I'd like to write a program capable of inspecting 4 identical parts mounted to fixtures, pitched 100mm apart from one another.
The user will be asked where each part came from (location on on the CNC machine)
Each report pdf will be named to identify where each part came from.
It will be possible to skip one or several of the parts.

The program I have allows me to do all of this except for the looping.

Manual alignment
Ask user part location
DCC alignment
Features
Dimensions
Report with pdf name identifying part location


Using the help file, I can create a simple looping program to measure the four parts, but I'm not sure how to include part identification and part skipping. I'd rather not have to have the program pause between parts while waiting for user input.
Parents
  • Just in case it's useful to someone else, here's what I have so far, which I tested and it works.
    Typically I set up file name variables in a way that reduces the chances of incorrect entry. This test program is pretty wide open.
    Unfortunately I won't have spare time to play tomorrow, so I'll have to figure out how to allow it to skip stations, if necessary, later.

    PART NAME  : Loop Test
    REV NUMBER : 1
    SER NUMBER :
    STATS COUNT : 1
    
    STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                ALIGNMENT/END
                MODE/MANUAL
                PREHIT/2
                RETRACT/2
                MOVESPEED/ 100
                TOUCHSPEED/ 1
                FLY/ON
                FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
    $$ NO,
                *************************
                Report Filename Variables
                *************************
    
                ASSIGN/PARTNAME=STR(GETTEXT(191,1,{FILEHEDR}))
                ASSIGN/REVNUMBER=STR(GETTEXT(192,1,{FILEHEDR}))
    $$ NO,
    
                ======================
                Identify part location
                ======================
    
    C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                Station 1 part identification:
                ASSIGN/LOCATION_1=C1.INPUT
    C2         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                Station 2 part identification:
                ASSIGN/LOCATION_2=C2.INPUT
    C3         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                Station 3 part identification:
                ASSIGN/LOCATION_2=C3.INPUT
    C4         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                Station 4 part identification:
                ASSIGN/LOCATION_2=C4.INPUT
    $$ NO,
    
                ====================
                Load probe and Align
                ====================
    
                LOADPROBE/1MM BY 20MM
                TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
    
    Feature for alignment
    Feature for alignment
    Feature for alignment
    
    A1         =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                  ALIGNMENT/LEVEL,ZPLUS,PLN1
                  ALIGNMENT/ROTATE,XPLUS,TO,LIN1,ABOUT,ZPLUS
                  ALIGNMENT/TRANS,XAXIS,PNT1
                  ALIGNMENT/TRANS,YAXIS,LIN1
                  ALIGNMENT/TRANS,ZAXIS,PLN1
                ALIGNMENT/END
                MODE/DCC
                CLEARP/ZPLUS,150,ZPLUS,0,OFF
                MOVE/CLEARPLANE
    $$ NO,
    
                ****
                Loop
                ****
    
                ASSIGN/COUNTER=0
                DO/
                ASSIGN/COUNTER=COUNTER+1
                IF/COUNTER==1
                  ASSIGN/FIXTURE_X=0
                  ASSIGN/LOCATION=C1.INPUT
                END_IF/
                IF/COUNTER==2
                  ASSIGN/FIXTURE_X=100
                  ASSIGN/LOCATION=C2.INPUT
                END_IF/
                IF/COUNTER==3
                  ASSIGN/FIXTURE_X=200
                  ASSIGN/LOCATION=C3.INPUT
                END_IF/
                IF/COUNTER==4
                  ASSIGN/FIXTURE_X=300
                  ASSIGN/LOCATION=C4.INPUT
                END_IF/
    $$ NO,
    
                ==============================
                Complete report name variables
                ==============================
    
                ASSIGN/VAR_REPORTNAME="R:\\PCDMIS Data\\Sample Programs\\Loop with DO_UNTIL\\Reports\\" + PARTNAME + "-" + REVNUMBER + LOCATION + " " + ".PDF"
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    
    
    LOOP_ORIGIN=GENERIC/POINT,DEPENDENT,CARTESIAN,$
                NOM/XYZ,<0+0,0+0,0+0>,$
                MEAS/XYZ,<FIXTURE_X,0+0,0+0>,$
                NOM/IJK,<0+0,0+0,0+1>,$
                MEAS/IJK,<0+0,0+0,0+1>
    A2         =ALIGNMENT/START,RECALL:A1,LIST=YES
                  ALIGNMENT/TRANS_OFFSET,XAXIS,LOOP_ORIGIN
                ALIGNMENT/END
    $$ NO,
    
                ************
                Part Program
                ************
    
    Features
    Features
    Dimensions
    Dimensions
    
    $$ NO,
                ************
                Print report
                ************
                PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=ON,AUTO=VAR_REPORTNAME,AUTO OPEN REPORT=OFF,$
                  TO_PRINTER=OFF,COPIES=1,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=YES,$
                  TO_EXCEL_OUTPUT=OFF,
                  PREVIOUS_RUNS=DELETE_INSTANCES
                UNTIL/COUNTER==4
    
Reply
  • Just in case it's useful to someone else, here's what I have so far, which I tested and it works.
    Typically I set up file name variables in a way that reduces the chances of incorrect entry. This test program is pretty wide open.
    Unfortunately I won't have spare time to play tomorrow, so I'll have to figure out how to allow it to skip stations, if necessary, later.

    PART NAME  : Loop Test
    REV NUMBER : 1
    SER NUMBER :
    STATS COUNT : 1
    
    STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                ALIGNMENT/END
                MODE/MANUAL
                PREHIT/2
                RETRACT/2
                MOVESPEED/ 100
                TOUCHSPEED/ 1
                FLY/ON
                FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
    $$ NO,
                *************************
                Report Filename Variables
                *************************
    
                ASSIGN/PARTNAME=STR(GETTEXT(191,1,{FILEHEDR}))
                ASSIGN/REVNUMBER=STR(GETTEXT(192,1,{FILEHEDR}))
    $$ NO,
    
                ======================
                Identify part location
                ======================
    
    C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                Station 1 part identification:
                ASSIGN/LOCATION_1=C1.INPUT
    C2         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                Station 2 part identification:
                ASSIGN/LOCATION_2=C2.INPUT
    C3         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                Station 3 part identification:
                ASSIGN/LOCATION_2=C3.INPUT
    C4         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                Station 4 part identification:
                ASSIGN/LOCATION_2=C4.INPUT
    $$ NO,
    
                ====================
                Load probe and Align
                ====================
    
                LOADPROBE/1MM BY 20MM
                TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
    
    Feature for alignment
    Feature for alignment
    Feature for alignment
    
    A1         =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                  ALIGNMENT/LEVEL,ZPLUS,PLN1
                  ALIGNMENT/ROTATE,XPLUS,TO,LIN1,ABOUT,ZPLUS
                  ALIGNMENT/TRANS,XAXIS,PNT1
                  ALIGNMENT/TRANS,YAXIS,LIN1
                  ALIGNMENT/TRANS,ZAXIS,PLN1
                ALIGNMENT/END
                MODE/DCC
                CLEARP/ZPLUS,150,ZPLUS,0,OFF
                MOVE/CLEARPLANE
    $$ NO,
    
                ****
                Loop
                ****
    
                ASSIGN/COUNTER=0
                DO/
                ASSIGN/COUNTER=COUNTER+1
                IF/COUNTER==1
                  ASSIGN/FIXTURE_X=0
                  ASSIGN/LOCATION=C1.INPUT
                END_IF/
                IF/COUNTER==2
                  ASSIGN/FIXTURE_X=100
                  ASSIGN/LOCATION=C2.INPUT
                END_IF/
                IF/COUNTER==3
                  ASSIGN/FIXTURE_X=200
                  ASSIGN/LOCATION=C3.INPUT
                END_IF/
                IF/COUNTER==4
                  ASSIGN/FIXTURE_X=300
                  ASSIGN/LOCATION=C4.INPUT
                END_IF/
    $$ NO,
    
                ==============================
                Complete report name variables
                ==============================
    
                ASSIGN/VAR_REPORTNAME="R:\\PCDMIS Data\\Sample Programs\\Loop with DO_UNTIL\\Reports\\" + PARTNAME + "-" + REVNUMBER + LOCATION + " " + ".PDF"
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    
    
    LOOP_ORIGIN=GENERIC/POINT,DEPENDENT,CARTESIAN,$
                NOM/XYZ,<0+0,0+0,0+0>,$
                MEAS/XYZ,<FIXTURE_X,0+0,0+0>,$
                NOM/IJK,<0+0,0+0,0+1>,$
                MEAS/IJK,<0+0,0+0,0+1>
    A2         =ALIGNMENT/START,RECALL:A1,LIST=YES
                  ALIGNMENT/TRANS_OFFSET,XAXIS,LOOP_ORIGIN
                ALIGNMENT/END
    $$ NO,
    
                ************
                Part Program
                ************
    
    Features
    Features
    Dimensions
    Dimensions
    
    $$ NO,
                ************
                Print report
                ************
                PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=ON,AUTO=VAR_REPORTNAME,AUTO OPEN REPORT=OFF,$
                  TO_PRINTER=OFF,COPIES=1,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=YES,$
                  TO_EXCEL_OUTPUT=OFF,
                  PREVIOUS_RUNS=DELETE_INSTANCES
                UNTIL/COUNTER==4
    
Children
No Data