Jump to content

Don’t create pdf if inspection fails


---
 Share

Recommended Posts

Operator manually attaches pdf to their data analysis tool without reviewing results to see if part is good or not. Customer wants to know if they can prevent pdf from being generated if part fails thinking operator will see that something needs his attention. I assume pcm could do this but is there something outside of pcm that they might be able to do.
Link to comment
Share on other sites

Hi Tom,
I can think of a way to do this with a PiWeb report, if that is what this customer is using. Is this the case?
Link to comment
Share on other sites

Alright, I actually ended up needing something to do for a bit since our CMM is down due to being out of cal, so I wrote up a little procedure for my idea. Again, I am not certain if this is what your customer is looking for Tom, but it may be of use in other facets of life. Notably, this relies on PiWeb and does not stop the creation of a report, it just loads a fully blank report.

I'm gonna be bored for a bit since the machine is down. If this isn't a solution you can work with, I can do some additional digging.

I hope you or someone else can find use in this.
6663_df53181db79b244dd35242d61856d9aa.pdf
Link to comment
Share on other sites

Please sign in to view this quote.

Hello Andy, Wow! Thank you. This is amazing work.

Unfortunately, I don't think we can count on the operator to pay attention to what is on the report. I was contemplating making the red indicator bigger. This just gave me an idea. Give me a few minutes....

Screenshot 2024-11-05 082008.jpg

Link to comment
Share on other sites

Here's my idea. It still requires the operator to look at the report but maybe this would be easier to see. I added a second traffic light and made the green and yellow colors transparent but left the red

Good.jpg

Link to comment
Share on other sites

Well, if you really want to make it obvious you could always use a condition statement on something after all the characteristics are evaluated that just breaks the run entirely if anything is out of tolerance. Sure, you wouldn't get a report at all, but it would be pretty clear something's wrong.
Link to comment
Share on other sites

Assuming they have PCM available, make it so that if any of the characteristics tolerance state == outOfTolerance do a systemCallWithWait() to a Powershell script that when executed goes to the directory where they are storing these PDFs, sort by last created, and then delete that one. This way there is nothing for the operators to attach.

Powershell script would look something like this -

# Set the path to the directory where you want to look for PDF files
$directoryPath = "C:\Path\To\Your\Directory"

# Check if the directory exists
if (Test-Path $directoryPath) {
# Get all PDF files in the directory, sort by creation time (newest first)
$pdfFiles = Get-ChildItem -Path $directoryPath -Filter *.pdf | Sort-Object CreationTime -Descending

# Check if there are any PDF files found
if ($pdfFiles.Count -gt 0) {
# Select the most recently created PDF file
$fileToDelete = $pdfFiles[0]

# Delete the file
Remove-Item -Path $fileToDelete.FullName -Force

# Output the name of the deleted file
Write-Host "Deleted file: $($fileToDelete.FullName)"
} else {
Write-Host "No PDF files found in the directory."
}
} else {
Write-Host "The directory does not exist."
}

ChatGPT is helpful here.
Link to comment
Share on other sites

Please sign in to view this quote.

Yea without PCM it becomes much more difficult, but not impossible to do what you are asking. PCM really is the key for getting the numbers inside Calypso to make things happen outside Calypso. Once you can communicate outside of Calypso, there is literally nothing you can't do.
Link to comment
Share on other sites

Please sign in to view this quote.

While this is creative, with PCM, you don't need to utilize Powershell in most cases

if (inspectionToleranceState("outOfTolerance") > 0) or (inspectionToleranceState("noResult") >0) then
	CalypsoRslt   = directoryPath("results")+"\"
	PDF_gra   = CalypsoRslt+getRecordHead("planid")+"_"+getRecordHead("partnbinc")+"_gra.pdf"  //use your name for output files syntax here
	PDF_ptx   = CalypsoRslt+getRecordHead("planid")+"_"+getRecordHead("partnbinc")+"_ptx.pdf"  //use your name for output files syntax here
	PDF_all   = CalypsoRslt+getRecordHead("planid")+"_"+getRecordHead("partnbinc")+"_all.pdf"  //use your name for output files syntax here

	
	wait(2) //can instead use 
	//waitForFile(PDF_ptx,"waiting for PDF",0,30,"no PDF Found",0)
	
	if fileExists(PDF_all)
		deleteFile(PDF_all)
	endif

	if fileExists(PDF_gra)
		deleteFile(PDF_gra)
	endif

	if fileExists(PDF_ptx)
		deleteFile(PDF_ptx)
	endif
	display("Inspection Results = FAIL")
	display("PDF deleted")
else
	display("Inspection Results = PASS")
	
endif
Try playing with that too
Link to comment
Share on other sites

Please sign in to view this quote.

I recently completed a programming project for them on a family of parts that would have benefited from having PCM. They may come around eventually.
Link to comment
Share on other sites

Hello, 

maybe something like this?

image.png.ea0221b39f95cb0e2653c9f26f82761c.png

 

Just copy the little traffic light make it BIG inside the header and make the gray indicator as transparent.png. With a right Mouse click you can set it into the background. Deselect inside the settings tab on the left (Output) Printer.

So it wont show up on the saved PDF..

image.thumb.png.bb58c1a35317c7f655fa3ad848780e42.png

 

Kind regards YM.

Edited
Link to comment
Share on other sites

You could implement N.i.O. into protocol path then delete N.i.O. ones later.

inspectionToleranceState()

It returns "inTolerance" or "outOfTolerance"

 

 

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...