hexagon logo

Printing reports In Patterned Program

I've got a part here that requires hundreds of inspections, so we created a fixture to run 15 of the parts in one execution so i'm not required to come back to the CMM every few minutes. I've hit a wall though where I need my reports to print per part and NOT have the previous part's dimensions. In other words, after each print command I want my results at that specific point in the program to be cleared so the next part's results will be the only results in the next report. This is important because I am going to import my results into another software for my Final Inspection Reports, and the software will only pick up the first part's dimensions if all the results are in one file. I'm a novice user, so if this will require any expressions/assign commands I will need as much explanation as possible. Thanks for any help! Slight smile
Parents
  • you could output via file/writeline before the end loop. it will output data to a CSV file.
    I've never been a big fan of PCDMIS default reports.
    The below is for a 4 cavity mold, with a fixture that holds 8 cavities, so it has some extra logic in it to run 8 parts and output cavity ID's of only 4 parts (twoshots).
    This routine is also parametric, it will measure the same parts with different sampling criteria as defined by our client. We measure more dim's at Startup and less dim's In-Process, so there's also logic/flow control to have one routine to measure every instance.

    at beginning of routine (before loop/start)
    ASSIGN/C_PATH="C:\PRODUCTION\customerx\partname\partcsvfile.CSV"
                          ASSIGN/ROUTINE="partnumber CMM Startup 8cav"
                ASSIGN/CHAR_2="AB.1 #10 Position "
                ASSIGN/CHAR_3="AB.2 #10 Position "
                ASSIGN/CHAR_4="AC #9 Position "
                ASSIGN/CHAR_5="AD #11 Position "
                ASSIGN/CHAR_7="AF #69 Position "
                ASSIGN/CHAR_8="AG.1 #129 Position "
                ASSIGN/CHAR_9="AG.2 #129 Position "
          LOT_NUM    =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'Lot#?'
    CAV_1      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 1?'
                IF_GOTO/QTY.INPUT<2,GOTO = ENDCAV
    CAV_2      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 2?'
                IF_GOTO/QTY.INPUT<3,GOTO = ENDCAV
    CAV_3      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 3?'
                IF_GOTO/QTY.INPUT<4,GOTO = ENDCAV
    CAV_4      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 4?'
                IF_GOTO/QTY.INPUT==4 AND TWOSHOTS.INPUT=="YES",GOTO = ENDCAV
                IF_GOTO/QTY.INPUT<5,GOTO = ENDCAV
    CAV_5      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 5?'
                IF_GOTO/QTY.INPUT<6,GOTO = ENDCAV
    CAV_6      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 6?'
                IF_GOTO/QTY.INPUT<7,GOTO = ENDCAV
    CAV_7      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 7?'
                IF_GOTO/QTY.INPUT<8,GOTO = ENDCAV
    CAV_8      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 8?'
                IF_GOTO/QTY.INPUT<2,GOTO = ENDCAV
    ENDCAV     =LABEL/
    USER       =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'Operator?'
    SCHEDULE   =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'Scheduled inspection time?'
                ASSIGN/RUN_ID=LOT_NUM.INPUT
                ASSIGN/OPERATOR=USER.INPUT
                ASSIGN/TIME=SCHEDULE.INPUT
    C_FILE     =FILE/OPEN,C_PATH,APPEND
                FILE/WRITELINE,C_FILE,"/PART NUMBER/" + "," + PART
                FILE/WRITELINE,C_FILE,"/ROUTINE NAME/" + "," + ROUTINE
                FILE/WRITELINE,C_FILE,"/LOT#/" + "," + RUN_ID
                FILE/WRITELINE,C_FILE,"/OPERATOR/" + "," + TRACE_FOLDER + "," + "Operator" + "," + OPERATOR
                FILE/WRITELINE,C_FILE,"/SCHEDULED TIME/" + "," + TRACE_FOLDER + "," + "Scheduled Time" + "," + TIME
                FILE/CLOSE,C_FILE,KEEP


    After Loop Start
    V1         =LOOP/START,ID=YES,NUMBER=MEASURE_COUNT,START=1,SKIP=,
                  OFFSET:XAXIS=2,YAXIS=0,ZAXIS=0,ANGLE=0
                IF/V1==1
                ASSIGN/POS=CAV_1.INPUT
                ASSIGN/PNUM=1
                END_IF/
                IF/V1==2
                ASSIGN/POS=CAV_2.INPUT
                ASSIGN/PNUM=2
                END_IF/
                IF/V1==3
                ASSIGN/POS=CAV_3.INPUT
                ASSIGN/PNUM=3
                END_IF/
                IF/V1==4
                ASSIGN/POS=CAV_4.INPUT
                ASSIGN/PNUM=4
                END_IF/
                IF/V1==5
                IF/QTY.INPUT==4 AND TWOSHOTS.INPUT=="YES"
                ASSIGN/POS=CAV_1.INPUT
                ASSIGN/PNUM=1
                END_IF/
                ELSE/
                ASSIGN/POS=CAV_5.INPUT
                ASSIGN/PNUM=5
                END_ELSE/
                END_IF/
                IF/V1==6
                IF/QTY.INPUT==4 AND TWOSHOTS.INPUT=="YES"
                ASSIGN/POS=CAV_2.INPUT
                ASSIGN/PNUM=2
                END_IF/
                ELSE/
                ASSIGN/POS=CAV_6.INPUT
                ASSIGN/PNUM=6
                END_ELSE/
                END_IF/
                IF/V1==7
                IF/QTY.INPUT==4 AND TWOSHOTS.INPUT=="YES"
                ASSIGN/POS=CAV_3.INPUT
                ASSIGN/PNUM=3
                END_IF/
                ELSE/
                ASSIGN/POS=CAV_7.INPUT
                ASSIGN/PNUM=7
                END_ELSE/
                END_IF/
                IF/V1==8
                IF/QTY.INPUT==4 AND TWOSHOTS.INPUT=="YES"
                ASSIGN/POS=CAV_4.INPUT
                ASSIGN/PNUM=4
                END_IF/
                ELSE/
                ASSIGN/POS=CAV_8.INPUT
                ASSIGN/PNUM=8
                END_ELSE/
                END_IF/
    


    Routine Code goes here, including all dimensions for each loop cycle. Then you output, still within Loop.
    C_FILE     =FILE/OPEN,C_PATH,APPEND
                FILE/WRITELINE,C_FILE,"/CAVITY ID/" + "," + TRACE_FOLDER + "," + "Position " + PNUM + "," + POS
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_1 + PNUM + "," + AA.D.MEAS
                IF_GOTO/AQL_IP_SU.INPUT<3,GOTO = IPCONT4
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_2 + PNUM + "," + AB_1.D.MEAS
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_3 + PNUM + "," + AB_2.D.MEAS
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_4 + PNUM + "," + AC.M.MEAS
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_5 + PNUM + "," + AD.M.MEAS
    IPCONT4    =LABEL/
                IF_GOTO/AQL_IP_SU.INPUT==1,GOTO = AQLSKIP4
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_6 + PNUM + "," + AE.M.MEAS
    AQLSKIP4   =LABEL/
                IF_GOTO/AQL_IP_SU.INPUT>1,GOTO = AQLSKIP5
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_6 + PNUM + "," + AE_AQL.M.MEAS
    AQLSKIP5   =LABEL/
                IF_GOTO/AQL_IP_SU.INPUT<3,GOTO = IPCONT5
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_7 + PNUM + "," + AF.M.MEAS
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_8 + PNUM + "," + AG_1.M.MEAS
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_9 + PNUM + "," + AG_2.M.MEAS

    end loop
Reply
  • you could output via file/writeline before the end loop. it will output data to a CSV file.
    I've never been a big fan of PCDMIS default reports.
    The below is for a 4 cavity mold, with a fixture that holds 8 cavities, so it has some extra logic in it to run 8 parts and output cavity ID's of only 4 parts (twoshots).
    This routine is also parametric, it will measure the same parts with different sampling criteria as defined by our client. We measure more dim's at Startup and less dim's In-Process, so there's also logic/flow control to have one routine to measure every instance.

    at beginning of routine (before loop/start)
    ASSIGN/C_PATH="C:\PRODUCTION\customerx\partname\partcsvfile.CSV"
                          ASSIGN/ROUTINE="partnumber CMM Startup 8cav"
                ASSIGN/CHAR_2="AB.1 #10 Position "
                ASSIGN/CHAR_3="AB.2 #10 Position "
                ASSIGN/CHAR_4="AC #9 Position "
                ASSIGN/CHAR_5="AD #11 Position "
                ASSIGN/CHAR_7="AF #69 Position "
                ASSIGN/CHAR_8="AG.1 #129 Position "
                ASSIGN/CHAR_9="AG.2 #129 Position "
          LOT_NUM    =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'Lot#?'
    CAV_1      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 1?'
                IF_GOTO/QTY.INPUT<2,GOTO = ENDCAV
    CAV_2      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 2?'
                IF_GOTO/QTY.INPUT<3,GOTO = ENDCAV
    CAV_3      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 3?'
                IF_GOTO/QTY.INPUT<4,GOTO = ENDCAV
    CAV_4      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 4?'
                IF_GOTO/QTY.INPUT==4 AND TWOSHOTS.INPUT=="YES",GOTO = ENDCAV
                IF_GOTO/QTY.INPUT<5,GOTO = ENDCAV
    CAV_5      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 5?'
                IF_GOTO/QTY.INPUT<6,GOTO = ENDCAV
    CAV_6      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 6?'
                IF_GOTO/QTY.INPUT<7,GOTO = ENDCAV
    CAV_7      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 7?'
                IF_GOTO/QTY.INPUT<8,GOTO = ENDCAV
    CAV_8      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'What cavity is
                in station 8?'
                IF_GOTO/QTY.INPUT<2,GOTO = ENDCAV
    ENDCAV     =LABEL/
    USER       =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'Operator?'
    SCHEDULE   =COMMENT/INPUT,NO,FULL SCREEN=YES,
                'Scheduled inspection time?'
                ASSIGN/RUN_ID=LOT_NUM.INPUT
                ASSIGN/OPERATOR=USER.INPUT
                ASSIGN/TIME=SCHEDULE.INPUT
    C_FILE     =FILE/OPEN,C_PATH,APPEND
                FILE/WRITELINE,C_FILE,"/PART NUMBER/" + "," + PART
                FILE/WRITELINE,C_FILE,"/ROUTINE NAME/" + "," + ROUTINE
                FILE/WRITELINE,C_FILE,"/LOT#/" + "," + RUN_ID
                FILE/WRITELINE,C_FILE,"/OPERATOR/" + "," + TRACE_FOLDER + "," + "Operator" + "," + OPERATOR
                FILE/WRITELINE,C_FILE,"/SCHEDULED TIME/" + "," + TRACE_FOLDER + "," + "Scheduled Time" + "," + TIME
                FILE/CLOSE,C_FILE,KEEP


    After Loop Start
    V1         =LOOP/START,ID=YES,NUMBER=MEASURE_COUNT,START=1,SKIP=,
                  OFFSET:XAXIS=2,YAXIS=0,ZAXIS=0,ANGLE=0
                IF/V1==1
                ASSIGN/POS=CAV_1.INPUT
                ASSIGN/PNUM=1
                END_IF/
                IF/V1==2
                ASSIGN/POS=CAV_2.INPUT
                ASSIGN/PNUM=2
                END_IF/
                IF/V1==3
                ASSIGN/POS=CAV_3.INPUT
                ASSIGN/PNUM=3
                END_IF/
                IF/V1==4
                ASSIGN/POS=CAV_4.INPUT
                ASSIGN/PNUM=4
                END_IF/
                IF/V1==5
                IF/QTY.INPUT==4 AND TWOSHOTS.INPUT=="YES"
                ASSIGN/POS=CAV_1.INPUT
                ASSIGN/PNUM=1
                END_IF/
                ELSE/
                ASSIGN/POS=CAV_5.INPUT
                ASSIGN/PNUM=5
                END_ELSE/
                END_IF/
                IF/V1==6
                IF/QTY.INPUT==4 AND TWOSHOTS.INPUT=="YES"
                ASSIGN/POS=CAV_2.INPUT
                ASSIGN/PNUM=2
                END_IF/
                ELSE/
                ASSIGN/POS=CAV_6.INPUT
                ASSIGN/PNUM=6
                END_ELSE/
                END_IF/
                IF/V1==7
                IF/QTY.INPUT==4 AND TWOSHOTS.INPUT=="YES"
                ASSIGN/POS=CAV_3.INPUT
                ASSIGN/PNUM=3
                END_IF/
                ELSE/
                ASSIGN/POS=CAV_7.INPUT
                ASSIGN/PNUM=7
                END_ELSE/
                END_IF/
                IF/V1==8
                IF/QTY.INPUT==4 AND TWOSHOTS.INPUT=="YES"
                ASSIGN/POS=CAV_4.INPUT
                ASSIGN/PNUM=4
                END_IF/
                ELSE/
                ASSIGN/POS=CAV_8.INPUT
                ASSIGN/PNUM=8
                END_ELSE/
                END_IF/
    


    Routine Code goes here, including all dimensions for each loop cycle. Then you output, still within Loop.
    C_FILE     =FILE/OPEN,C_PATH,APPEND
                FILE/WRITELINE,C_FILE,"/CAVITY ID/" + "," + TRACE_FOLDER + "," + "Position " + PNUM + "," + POS
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_1 + PNUM + "," + AA.D.MEAS
                IF_GOTO/AQL_IP_SU.INPUT<3,GOTO = IPCONT4
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_2 + PNUM + "," + AB_1.D.MEAS
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_3 + PNUM + "," + AB_2.D.MEAS
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_4 + PNUM + "," + AC.M.MEAS
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_5 + PNUM + "," + AD.M.MEAS
    IPCONT4    =LABEL/
                IF_GOTO/AQL_IP_SU.INPUT==1,GOTO = AQLSKIP4
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_6 + PNUM + "," + AE.M.MEAS
    AQLSKIP4   =LABEL/
                IF_GOTO/AQL_IP_SU.INPUT>1,GOTO = AQLSKIP5
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_6 + PNUM + "," + AE_AQL.M.MEAS
    AQLSKIP5   =LABEL/
                IF_GOTO/AQL_IP_SU.INPUT<3,GOTO = IPCONT5
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_7 + PNUM + "," + AF.M.MEAS
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_8 + PNUM + "," + AG_1.M.MEAS
                FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_9 + PNUM + "," + AG_2.M.MEAS

    end loop
Children
  • Note this output will make the data report with one dimension per row of CSV. if you want to consolidate all the DIM's into one row, just do a single file/writeline and output each dimension value separated by a comma. "AA.D.MEAS, AB_1.D.MEAS, AB_2.D.MEAS, AC.M.MEAS, AD.M.MEAS, AE.M.MEAS, AE_AQL.M.MEAS, AF.M.MEAS, AG_1.M.MEAS, AG_2.M.MEAS"