Jump to content

PDF File PiWeb Reporting - File Overwriting Issues


---
 Share

Recommended Posts

Hi all,

I wanted to know if anyone has a solution for a problem I am seeing.

Example: We run parts and have the PDF Files setup to autosave at the completion of a run. Say I run "Part A_Run 1" and it fails. I modify it and need to run it again, it should be "Part A_Run 2" and if so, everything works fine. What is happening is that operators aren't remembering to correctly rename the Run number so the might run another "Part A_Run 1" and it overwrites the file in the directory we have it going to without asking something like "Are you sure you want to save over this?" or "There is already something named this...blah blah"

Is there a way to prevent file over-writes so that we don't have this happen? Lost a few files today because of this issue and I don't have an easy fix for it without telling the operators you really need to pay attention to the Run number to ensure you aren't repeating something already in the folder.

Thanks

Link to comment
Share on other sites

I would set up variable file naming and probably use getRecHdForFil("time") to add a timestamp to the file name. That way it should be unique even if the same run number is used.

Edited
Changed PCM command to file-safe one
  • Like! 3
Link to comment
Share on other sites

Please sign in to view this quote.

Love that idea! It won't change the inputs the operator has to make but will add a timestamp to the file whenever it is saved to prevent the overwrite issue I am seeing. Thank you for this!

Link to comment
Share on other sites

  • 2 weeks later...

The following creates a file name that will never overwrite. It appends a Date and Time to each file name.

"<Some Drive letter>:\CMM Data Files\Table Files"+"\"+getRecordHead("drawingno")+"\"+getRecordHead("order")+"\"+getRecordHead("dmesn")+"\"+getRecordHead("planid")+"_"+getRecordHead("partnbinc")+"_"+getRecordHead("date")+"_"+getRecordHead("time")+"_"+"hdr.txt"

The above also nests data in a set of Folders for traceability.

drawingno = Part Number

order = Our Job Number

dmesn = CMM the part was run on

partnbinc = Part Counter (We use this as a counter and or Serial Number)

date = Current Date at time of file creation

time = Current time at file creation

Example file name: <Some Part Number>_B_Targetting_RDS_05-11-20261_SC-028_2026-8-31_2_05_36 PM_.pdf

Program Name

Serial Number or Part Counter

Creation Date

Actual Time (2:05:36 PM)

Link to comment
Share on other sites

 Share

×
×
  • Create New...