hexagon logo

How can I save past runs as individual files

Hello,

I am relatively new to CMM programing. I was wondering if there was any way to set up a system where when a measurement routine ends, the program automatically saves the routine with the measurement points for that specific serial number to a set file directory. It's been a hassle for when I forget to print out a report at the end of a routine, go to run the next part and I lose my information for the previous one forever. I would like to have it set up as to where, when a measurement routine ends, the program asks me what i could like to name the file, and where to save it. Would someone with more knowledge of the program be able to assist me with some code that I can put in my programs so that this can be done, please?

Thanks
Parents
  • This is how I save my PDFs.

    Operator runs program. Operator gets two pop-up comments where they have to type in a "serial number" and a "run number".

    Once program is done, it "prints" the inspection rpt as a PDF to a folder I set up. The PDF itself will get named by the operator's inputs & by the exact date & time it gets created so it will always be uniquely named. I have it set up so you don't even have to open it to see if it's rejected or not.

    This is at the top of my program
    SERIALNUMBERQUESTION =COMMENT/INPUT,NO,FULL SCREEN=NO,
    Serial Number:
    ASSIGN/VAR_SERIAL_NUMBER=UPPERCASE(SERIALNUMBERQUESTION.INPUT)
    ASSIGN/VAR_SERIALNUMBER_STATEMENT="Serial Number: "+VAR_SERIAL_NUMBER
    COMMENT/REPT,
    
    COMMENT/REPT,
    VAR_SERIALNUMBER_STATEMENT
    RUNNUMBERQUESTION =COMMENT/INPUT,NO,FULL SCREEN=NO,
    Run Number:
    IF_GOTO/RUNNUMBERQUESTION.INPUT<1 OR RUNNUMBERQUESTION.INPUT>9999,GOTO = RUNNUMBERQUESTION
    IF_GOTO/LEN(RUNNUMBERQUESTION.INPUT)>4,GOTO = RUNNUMBERQUESTION
    ASSIGN/VAR_RUNNUMBER=FORMAT("%04d",INT(RUNNUMBERQUESTION. INPUT))
    ASSIGN/VAR_RUNNUMBER_STATEMENT="Run Number: "+VAR_RUNNUMBER
    COMMENT/REPT,
    VAR_RUNNUMBER_STATEMENT
    


    code goes here
    code goes here
    code goes here
    code goes here
    code goes here
    code goes here
    code goes here
    code goes here
    code goes here
    code goes here


    This is at the bottom of my program
    ASSIGN/NUMOOT=GETPROGRAMINFO("NUMOOT")
    ASSIGN/PROG_NAME=GETPROGRAMINFO ("PARTNAME")
    ASSIGN/DATE=STR(SYSTEMDATE ("dMMMyyyy"))
    ASSIGN/TIME=STR(SYSTEMTIME ("HHmmss"))
    ASSIGN/REJECT="____REJECT____"
    IF/NUMOOT=="0"
    ASSIGN/REPORT_NAME="O:\\CMM PROGRAMS\\CMM_PDF_PC DMIS\\AG0OFFLINETEST\\"+PROG_NAME+"__"+VAR_SERIAL_ NUMBER+"__"+VAR_RUNNUMBER+"__"+DATE+"__"+TIME+"__. PDF"
    END_IF/
    ELSE/
    ASSIGN/REPORT_NAME="O:\\CMM PROGRAMS\\CMM_PDF_PC DMIS\\AG0OFFLINETEST\\"+PROG_NAME+"__"+VAR_SERIAL_ NUMBER+"__"+VAR_RUNNUMBER+"__"+DATE+"__"+TIME+"__" +REJECT+".PDF"
    END_ELSE/
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,AUTO=1,AUTO OPEN=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME= REPORT_NAME,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL=OFF,$
    PREVIOUS_RUNS=KEEP_INSTANCES
    


    Other people will chime in for the other parts of the answer you requested.


    thank you! I will give it a shot
Reply
  • This is how I save my PDFs.

    Operator runs program. Operator gets two pop-up comments where they have to type in a "serial number" and a "run number".

    Once program is done, it "prints" the inspection rpt as a PDF to a folder I set up. The PDF itself will get named by the operator's inputs & by the exact date & time it gets created so it will always be uniquely named. I have it set up so you don't even have to open it to see if it's rejected or not.

    This is at the top of my program
    SERIALNUMBERQUESTION =COMMENT/INPUT,NO,FULL SCREEN=NO,
    Serial Number:
    ASSIGN/VAR_SERIAL_NUMBER=UPPERCASE(SERIALNUMBERQUESTION.INPUT)
    ASSIGN/VAR_SERIALNUMBER_STATEMENT="Serial Number: "+VAR_SERIAL_NUMBER
    COMMENT/REPT,
    
    COMMENT/REPT,
    VAR_SERIALNUMBER_STATEMENT
    RUNNUMBERQUESTION =COMMENT/INPUT,NO,FULL SCREEN=NO,
    Run Number:
    IF_GOTO/RUNNUMBERQUESTION.INPUT<1 OR RUNNUMBERQUESTION.INPUT>9999,GOTO = RUNNUMBERQUESTION
    IF_GOTO/LEN(RUNNUMBERQUESTION.INPUT)>4,GOTO = RUNNUMBERQUESTION
    ASSIGN/VAR_RUNNUMBER=FORMAT("%04d",INT(RUNNUMBERQUESTION. INPUT))
    ASSIGN/VAR_RUNNUMBER_STATEMENT="Run Number: "+VAR_RUNNUMBER
    COMMENT/REPT,
    VAR_RUNNUMBER_STATEMENT
    


    code goes here
    code goes here
    code goes here
    code goes here
    code goes here
    code goes here
    code goes here
    code goes here
    code goes here
    code goes here


    This is at the bottom of my program
    ASSIGN/NUMOOT=GETPROGRAMINFO("NUMOOT")
    ASSIGN/PROG_NAME=GETPROGRAMINFO ("PARTNAME")
    ASSIGN/DATE=STR(SYSTEMDATE ("dMMMyyyy"))
    ASSIGN/TIME=STR(SYSTEMTIME ("HHmmss"))
    ASSIGN/REJECT="____REJECT____"
    IF/NUMOOT=="0"
    ASSIGN/REPORT_NAME="O:\\CMM PROGRAMS\\CMM_PDF_PC DMIS\\AG0OFFLINETEST\\"+PROG_NAME+"__"+VAR_SERIAL_ NUMBER+"__"+VAR_RUNNUMBER+"__"+DATE+"__"+TIME+"__. PDF"
    END_IF/
    ELSE/
    ASSIGN/REPORT_NAME="O:\\CMM PROGRAMS\\CMM_PDF_PC DMIS\\AG0OFFLINETEST\\"+PROG_NAME+"__"+VAR_SERIAL_ NUMBER+"__"+VAR_RUNNUMBER+"__"+DATE+"__"+TIME+"__" +REJECT+".PDF"
    END_ELSE/
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,AUTO=1,AUTO OPEN=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME= REPORT_NAME,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL=OFF,$
    PREVIOUS_RUNS=KEEP_INSTANCES
    


    Other people will chime in for the other parts of the answer you requested.


    thank you! I will give it a shot
Children
No Data