Jump to content

PCM trouble


---
 Share

Recommended Posts

I recently got a line of PCM code from Mr. Flores, (Thanks again Roberto) that allows me to select specific data from my measurement plan, and save it to a specific drive/folder. It works fine, but I need it to be saved as an .xls file. It also saves data from each run three different ways, I need only the one named; "121147" I need the other two files to go away. I also need a way for the operator to enter a lot number to identify the file being generated by the PCM.

Any help would be greatly appreciated.

May 21, 2018 120743 pm.txtMay 21, 2018 121025 pm.txtMay 21, 2018 121147 pm.txt

Link to comment
Share on other sites

I took the code Roberto gave me, and added a result element. Inside the Result Input dialog text, I entered "Enter Lot Number" this prompts the operator to enter a number which shows up in the report. (Code below). As I said, I got this to work outside of autorun. Does anyone know how to get this to work in autorun?

//Dims to notepad
filePath = "T:\Medtronic_Data\"
ext = ".txt"

N1 = getRecordHead ("Grind Tang_Rev. B 9.22.16_543_.0934")
dirPath = filePath + N1 + (" ") +date()+" "+time()+ ext

//
LN = getActual("Lot Number").actual
//#1
DIM200_1 = getActual("200 - Profile_1").actual
//#2
DIM200_2 = getActual("200 - Profile_2").actual

addToFile(dirPath,date())
addToFile(dirPath,time())
addToFile(dirPath,("T:\Medtronic_Data"))
addToFile(dirPath,("Lot Number : "),LN)
addToFile(dirPath,("200 - Profile_1 : "),DIM200_1)
addToFile(dirPath,("200 - Profile_2 : "),DIM200_2)

//Dims to Excel
// Code is identical, but TXT has been changed to CSV
filePath = "T:\Medtronic_Data\"
ext = ".csv"
Link to comment
Share on other sites

So what i sent you should only save 2 files, not 3....
but i think the easiest answer is that there are 2 sections, 1 headed with "Dims to Notepad", and 1 headed with Dims to Excel.
I did this so you could have the option of using a textfile or an excel file.
if you wipe out the top half, the Dims to notepad section will stop reporting.
but in short using the extension ".CSV" will create an excel file.

//Dims to excel
filePath = "T:\Medtronic_Data\"
ext = ".csv"

N1 = getRecordHead ("Grind Tang_Rev. B 9.22.16_543_.0934")
dirPath = filePath + N1 + (" ") +date()+" "+time()+ ext

//
LN = getActual("Lot Number").actual
//#1
DIM200_1 = getActual("200 - Profile_1").actual
//#2
DIM200_2 = getActual("200 - Profile_2").actual

addToFile(dirPath,date())
addToFile(dirPath,time())
addToFile(dirPath,("T:\Medtronic_Data"))
addToFile(dirPath,("Lot Number : "),LN)
addToFile(dirPath,("200 - Profile_1 : "),DIM200_1)
addToFile(dirPath,("200 - Profile_2 : "),DIM200_2)

Let me know if you need any help.
Link to comment
Share on other sites

Roberto, sorry to keep bugging you. The PCM for saving variable data to an excel (.csv) file works well, but now they want the file name to have the lot # in it for so the customer can look at data by lot #. Currently the file is automatically named with the PCM by the time and date it is created, i.e. [May 29, 2018 113454] Would it be as simple as adding a line that automatically saves the .csv file using a previously entered lot number from the Zeiss characteristic.xlt?

Thanks in advance!
Link to comment
Share on other sites

Not a problem Clarke
I personally use the user input in my VPHEAD called "lotid"
so getRecordHead ("lotid") would be the recall for that.
if you don't use this variable you can go into your VPHEAD and right click on the input that you use and see the recall name for that variable, see picture.

You can do this a couple different ways, the easiest would be to just insert it directly in the string.
So the dirPath would look like this.....
dirPath = filePath + N1 + (" ") + getRecordHead ("lotid") + (" ") +date()+(" ")+time()+ ext

Let me know

aspect1.png

Link to comment
Share on other sites

I see you are using the Custom printout for this. I am using a spreadsheet. Will this same process work for a .xls report?
Link to comment
Share on other sites

We use custom printouts for our operators, and text reports for the dims needing SPC logging (automatic).
but every program we have regardless of SPC has operator inputs for WO# and Part Number.
Whatever you use for your operators to input lot number information, that's what you need to get.
I'm thinking header info would be the easiest way, but if you use another method then im sure it should be just as easy to put that data in the file name, but you need to figure out where that input is taking place.
Link to comment
Share on other sites

 Share

×
×
  • Create New...