hexagon logo

Excel Files lost

Hello All!
I am relatively new to the CMM programming world and am curious about a potential coding work around for Poor network connectivity issues. In short, our CMM is set to save the excel files directly to a pre-specified network folder so that they may be accessed by our engineering team in another facility about 40 miles away. our network connectivity is quite shoddy at times and when that port goes down all Excel data appears to be "Lost" is this information stored anywhere locally? or is it simply gone? if it isnt backed up anywhere is there a way i can set up PC-DMIS to duplicate the export in another location?
  • Yes you can make it save locally too. What method are you using to write to the network? Script? Print Command? Report Window Setup? You can use all of there in conjunction with one another and write the same data to several locations at the same time. I currently write to a PDF and two different Excel files. One excel and the PDF are full runs and the 2nd Excel is only the data that we want to do SPC on.


    Edit: And I also sometimes have it print the reports
  • the current setup exports the data in PDF format as well as Excel through the print setup screen. What would be the proper command chain for the duplicated excel export?
  • This is what we use to output via assignments and file/writeline commands.
    There are a bunch of omitted comment inputs, and it's segmented because there are loop iterations also omitted.
    -But it's a great baseline to understand how to output data to excel.

    At the end if you didn't notice, we are taking a locally created C drive file, and moving it over to a network path (t drive). We've had instances of PCDMIS skipping sections of data output when writing directly to network location, this was the fix.

    ASSIGN/T_PATH="T:\MEASURLINK_TRANSFER\CMM CM-004\M44_CARRIER_CAP_SU_IMPORT.CSV"
                ASSIGN/C_PATH="C:\PRODUCTION\MERIDIAN\CARRIER CAP\M44_CARRIER_CAP_SU.CSV"
                ASSIGN/C_TEMP="C:\PRODUCTION\C_TRANSFER\M44_CARRIER_CAP_SU.CSV"
    TFILE_CHECK=FILE/EXISTS,T_PATH
                IF/TFILE_CHECK==1
                FILE/DELETE,T_PATH
                END_IF/
    CFILE_CHECK=FILE/EXISTS,C_TEMP
                IF/CFILE_CHECK==1
                FILE/DELETE,C_TEMP
                END_IF/
    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
    C_TEMPFILE1=FILE/OPEN,C_TEMP,APPEND
                FILE/WRITELINE,C_TEMPFILE1,"/PART NUMBER/" + "," + PART
                FILE/WRITELINE,C_TEMPFILE1,"/ROUTINE NAME/" + "," + ROUTINE
                FILE/WRITELINE,C_TEMPFILE1,"/LOT#/" + "," + RUN_ID
                FILE/WRITELINE,C_TEMPFILE1,"/OPERATOR/" + "," + TRACE_FOLDER + "," + "Operator" + "," + OPERATOR
                FILE/WRITELINE,C_TEMPFILE1,"/SCHEDULED TIME/" + "," + TRACE_FOLDER + "," + "Scheduled Time" + "," + TIME
                FILE/CLOSE,C_TEMPFILE1,KEEP
    C_FILE2    =FILE/OPEN,C_PATH,APPEND
                FILE/WRITELINE,C_FILE2,"/CAVITY ID/" + "," + TRACE_FOLDER + "," + "Position " + V1 + "," + POS1
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_1 + V1 + "," + AB_1.MEAS
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_2 + V1 + "," + AC_1.MEAS
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_3 + V1 + "," + AD_1.MEAS
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_4 + V1 + "," + AF_1.MEAS
                FILE/WRITELINE,C_FILE2,"/CAVITY ID/" + "," + TRACE_FOLDER + "," + "Position " + V2 + "," + POS2
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_1 + V2 + "," + AB_2.MEAS
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_2 + V2 + "," + AC_2.MEAS
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_3 + V2 + "," + AD_2.MEAS
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_4 + V2 + "," + AF_2.MEAS
                FILE/WRITELINE,C_FILE2,"/CAVITY ID/" + "," + TRACE_FOLDER + "," + "Position " + V3 + "," + POS3
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_1 + V3 + "," + AB_3.MEAS
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_2 + V3 + "," + AC_3.MEAS
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_3 + V3 + "," + AD_3.MEAS
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_4 + V3 + "," + AF_3.MEAS
                FILE/WRITELINE,C_FILE2,"/CAVITY ID/" + "," + TRACE_FOLDER + "," + "Position " + V4 + "," + POS4
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_1 + V4 + "," + AB_4.MEAS
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_2 + V4 + "," + AC_4.MEAS
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_3 + V4 + "," + AD_4.MEAS
                FILE/WRITELINE,C_FILE2,"/DATA/" + "," + CHAR_4 + V4 + "," + AF_4.MEAS
    C_TEMPFILE2=FILE/OPEN,C_TEMP,APPEND
                FILE/WRITELINE,C_TEMPFILE2,"/CAVITY ID/" + "," + TRACE_FOLDER + "," + "Position " + V1 + "," + POS1
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_1 + V1 + "," + AB_1.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_2 + V1 + "," + AC_1.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_3 + V1 + "," + AD_1.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_4 + V1 + "," + AF_1.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/CAVITY ID/" + "," + TRACE_FOLDER + "," + "Position " + V2 + "," + POS2
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_1 + V2 + "," + AB_2.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_2 + V2 + "," + AC_2.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_3 + V2 + "," + AD_2.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_4 + V2 + "," + AF_2.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/CAVITY ID/" + "," + TRACE_FOLDER + "," + "Position " + V3 + "," + POS3
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_1 + V3 + "," + AB_3.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_2 + V3 + "," + AC_3.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_3 + V3 + "," + AD_3.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_4 + V3 + "," + AF_3.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/CAVITY ID/" + "," + TRACE_FOLDER + "," + "Position " + V4 + "," + POS4
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_1 + V4 + "," + AB_4.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_2 + V4 + "," + AC_4.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_3 + V4 + "," + AD_4.MEAS
                FILE/WRITELINE,C_TEMPFILE2,"/DATA/" + "," + CHAR_4 + V4 + "," + AF_4.MEAS
                FILE/CLOSE,C_TEMPFILE2,KEEP
    C_FILE     =FILE/OPEN,C_PATH,APPEND
                FILE/WRITELINE,C_FILE,"/END/"
                FILE/CLOSE,C_FILE,KEEP
    C_TEMPFILE3=FILE/OPEN,C_TEMP,APPEND
                FILE/WRITELINE,C_TEMPFILE3,"/END/"
                FILE/CLOSE,C_TEMPFILE3,KEEP
                FILE/MOVE,C_TEMP,T_PATH
    
  • ASSIGN/ST_TM=SYSTEMTIME("HH-mm-ss")
                ASSIGN/SYS_DT=SYSTEMDATE("MM-dd-yyy'")
                ASSIGN/MTI1="S:\[COLOR=#FF0000][B]MAKE THIS THE PATH YOU WANT TO WRITE TO[/B][/COLOR]\\"
                ASSIGN/MTI2="[COLOR=#FF0000][B]MAKE THIS YOUR FILE NAME[/B][/COLOR]"
                ASSIGN/MTI3=CONCAT(MTI2," CAVITY-",C1.INPUT," ",ST_TM," ",SYS_DT) [B][COLOR=#FF0000]<----<<< THIS LINE ADDS CAVITY NUMBER "C1.INPUT" AND SYS DATE AND TIME TO THE FILE NAME [/COLOR][/B]
                ASSIGN/MTI4=CONCAT(MTI1,MTI3) [B][COLOR=#FF0000]<----<<< THIS LINE CONCATINATES EVERYTHING TOGETHER INTO A PATH AND FILE NAME[/COLOR][/B]
                PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=[B][COLOR=#FF0000]ON[/COLOR][/B],[COLOR=#0000FF]APPEND[/COLOR]=MTI4,AUTO OPEN REPORT=[COLOR=#0000FF]OFF[/COLOR],$ [B][COLOR=#FF0000]<----<<< WRITES OUT A PDF TO YOUR PATH AND FILE NAME ABOVE WILL OVERWRITE OR [/COLOR][COLOR=#0000FF]APPEND AND WILL OPEN THE REPORT TO BE VIEWED BY THE OPERATOR[/COLOR][/B]
                  TO_PRINTER=OFF,COPIES=1,$[B][COLOR=#FF0000]<----<<< [/COLOR][/B][B][COLOR=#FF0000]THIS LINE SENDS THE pdf TO THE PRINTER 1 COPY OR SEVERAL[/COLOR][/B]
                  TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                  REPORT_THEORETICALS=ALL,REPORT_FEATURE_WITH_DIMENSIONS=YES,$
                  TO_EXCEL_OUTPUT=OFF,[B][COLOR=#FF0000]<----<<< [/COLOR][/B][B][COLOR=#FF0000]THIS LINE SENDS EXCEL OUTPUTS TO THE ABOVE DIRECTORY[/COLOR][/B]
                  PREVIOUS_RUNS=DELETE_INSTANCES


    If you turn off the DELETE INSTANCES you can stack another one of these below the first and send all of this data to another location as PDF, EXCEL, or hard copy.