Jump to content

Save result in excel using PCM


---
 Share

Recommended Posts

you could help me look at this example a long time ago but I am having sintasys errors I am trying to have the result saved in an excel format using PCM but I do not have much knowledge if you can guide me, this is what I am doing:

image.jpg

Link to comment
Share on other sites

Possibly try changing your extension to ".CSV".
CSV is an excel format and will change itself into an XLS or XLXS when it is generated.
Your filePath should end in an \ if you're adding to it as a part of a longer address.

Also i see you have your extension included in your filePath line, but then in your dirPath you add N1 + Lot +PN + another extension after the filePath

Also, does getRecordHead for part number start with a capital P or lower case p?

so your final result will be
C:\Doc n Set\admin\desktop\test.xlsN1inputLotinput_partNumberinc.xls

filepath1.JPG

Link to comment
Share on other sites

You can already get it to be finalized but I need the results of each of the evolutions of the dimensions to be saved in the same Excel file.
Example: Piece # 1, Piece # 2 ... ..Ect.


Presettings
LN = getRecordHead("order")

Postsettings

rotateReference()

//Dims to Excel
filePath = "C:\Documents and Settings\Administrator\Desktop\Tang Flat Profile_.0934\feature 200.xlx\"
ext = ".csv"


//N1 = getRecordHead ("Grind Tang_Rev. B 9.22.16_543_.0934")
//dirPath = filePath + N1 + (" ") +date()+" "+time()+ ext
Lot = getRecordHead("order")
partnum=getRecordHead("partnbinc")
dirPath=filePath+Lot+ (" ") +date()+" "+time()+ ext
display(dirPath)
if fileExists(dirPath) == true
deleteFile(dirPath)
endif
//#1
DIM200_1 = getActual("200 - Profile_1").actual

addToFile(dirPath,date())
addToFile(dirPath,time())
addToFile(dirPath,("Lot Number : "),LN)
addToFile(dirPath,("200 - Profile_1 : "),DIM200_1)

PCM.rtf

Link to comment
Share on other sites

I don't have any programs where i "append" a program, adding to it.
All my programs i create i "overwright" or since i'm sending to a folder to be digested by Winspc, the file that i save to is emptied every 10 seconds or so there's very few instances where the same part file is saved to a folder, but if it does happen then the file is overwritten.
Winspc will grab the file and process it, then move the file into another archive folder.
We "Bag & Tag" every part we make so im safe creating a new file that consists of "Partnumber_workorder_individualPartNumber.txt".
Link to comment
Share on other sites

The ".xlx" will not cause any issues. And as you see it's not an extension of a file, it's part of the path name "....\feature_200.xlx\file.csv"

You can simply append to the csv-file if you need more then one part in the same file. How ever, that can become messy quite quick. Since csv don't support tabs. That can be fixed by a script that place every measurement in a tab of it's own and creates a "real" excel file. If that's the target.
Link to comment
Share on other sites

the idea is to be able to save the results in an excel format that handles SPC graphics as we do not have an SPC software so we are trying to use these Excel formats
Link to comment
Share on other sites

  • 9 months later...
For a part family:

This will prompt the operator to choose which size part they want
to run. It will also save dimensions 200a & 200b to a separate folder.
150_fb1bad4bfed75a82d11256e38b1f807e.docx
Link to comment
Share on other sites

 Share

×
×
  • Create New...