hexagon logo

Export data to a text file without Datapage

I see a lot of questions about how to export data to a text file. I have a program that checks a golden part. I want to export certain measurments to a text file to automatically import into Excel at a later time. I also want to record the day and time the program is run and the serial number of the probe module used for that run. I do not have Datapage.

This is how I do it in 4.2MR1:
After I take my measurments I export the data with File I/O commands.

From the menu:
Insert -> File I/O Command -> File Open
Insert -> File I/O Command -> Writing Commands -> Write Line
Insert -> File I/O Command -> File Close

COMMENT/REPT, Global Machine
                        , 
FPTR       =FILE/OPEN,N:\QA\CMMDATA\DATASTORE\GLOBAL.TXT,APPEND
            FILE/WRITELINE,FPTR,SYSTEMTIME ("hh':'mm")+","+SYSTEMDATE("MM'/'dd'/'yy")+","+LOWER_2_HOLE.D+","+D_1.MEAS+","+D_2.MEAS+","+UL_50.Y+","+ROUND_1.MEAS+","+WORK_ORDER.INPUT+","+TOP_PLANE.Z
            FILE/CLOSE,FPTR,KEEP


In my case, this exports Time, Date, Diameter, 2d-distance, 2d-distance, Y axis position, roundness, user input, and z-height to a Text file stored on our network server that can be retrieved anywhere from the network.

This info is put onto its own line in the text file GLOBAL.TXT each time to program is run. It can then be imported into Excel or any other software package that take a CSV/TXT file as input.

Have fun with it....
Parents
  • You can put it in at any point after you have measured the features you want to export. I usually put this line after I write my standard .pdf output file. There is no reason you couldn't put it at the begning of your program to just export the time the program started or something. (Obviously there would be no part data at that point.)
Reply
  • You can put it in at any point after you have measured the features you want to export. I usually put this line after I write my standard .pdf output file. There is no reason you couldn't put it at the begning of your program to just export the time the program started or something. (Obviously there would be no part data at that point.)
Children
No Data