Jump to content

Disable multiple report printing via PCM


---
 Share

Recommended Posts

Hi everybody!

Can any of you tell me if there is a PCM command to disable multiple report printing (PiWeb)?
I know the presentationOff() function that disables the presentation protocol, but I haven't found anything that does the same for the PiWeb protocol...
My goal is to print only the non-conforming part reports.
Your help on this subject would be greatly appreciated and would allow us to save a lot of paper! 😃
Link to comment
Share on other sites

So far there is no PCM command similar to presentationOff() (PCM requirement is in our Backlog)

Workaround: save the pdf and print it with a script if necessary
inspectionToleranceState() //supplies the tolerance status of the Measurement Plan

Alternative:
Use multiple protocol / characteristic ==> out of tolerance.
However, it always generates a header page if all characteristics are within tolerance
Link to comment
Share on other sites

Hallo Günter,

Thank you for your answer.
I think I will need the workaround, because I want nothing to be printed when the part is OK.
I was also thinking about this solution.
I don't know what the easiest way to create and run a script is.
I've already tried a few things with systemCallIcon() and systemCallForResultAccess() to run a .cmd file, but it doesn't seem to work.
If anyone has an idea or experience to share, he is welcome!
Link to comment
Share on other sites

If it's not a problem to press the green button after the run maybe this will help:

if inspectionToleranceState().asString == "inTolerance"
message("Alle Prüfmerkmale in Ordnung",cr(),"Ablauf wird abgebrochen")
cncBreak()
endif
Link to comment
Share on other sites

Hallo Reiner,

that is a very good idea... unfortunately not for me: we have a pallet program with 4 parts and cannot stop the CNC measurement after the first part.
Shouldn't it be possible to switch off the print output? You can do so much with PCM...
Link to comment
Share on other sites

Sebastian,
can you try this:
Define all desired settings and save a “Multi Report” setting.
E.g. “test-print”
882_8f325185b863386629a9ee77e136a955.png
Call up the desired setting via PCM
Example:
setProtocolSetting("multiProtDefName", "test-print") // My own setting
setProtocolSetting("multiProtDefName", "default_PR1") // StandardProtocol Setting
setProtocolSetting("multiProtDefName", "default_PiWebAccept1") // AcceptProtocol Setting
Link to comment
Share on other sites

Hi Günter,

This idea looks perfect and is exactly what I want to do.
Taken individually, the elements of the solution work perfectly: I tested them individually.
But when I run the program, nothing happens: the setting of the multiple report remains unchanged.
The weirdest thing is that when I execute the setProtocolSetting() code manually (by clicking on the magnifying glass icon) it works, but as soon as I run it in CNC, it doesn't work anymore.
Here is the code I used for my test in the output settings:
status = inspectionToleranceState()
if status == "inTolerance" then 
	message("OK")
	setProtocolSetting("multiProtDefName", "default_PiWebAccept1")
else
	message("not OK")
	setProtocolSetting("multiProtDefName", "default_PR1") // StandardProtocol Setting
endif
Link to comment
Share on other sites

Sebastian,
your PCM code is correct.
Sorry, but the PCM call for reporting is too late. The report settings are set at the very beginning. Unfortunately, this method does not work. I take the switching of the reports with PCM into our backlog
Link to comment
Share on other sites

Günter,
Thanks for the additional information, even if it doesn't help me at the moment.
But I still don't understand how to use setProtocolSetting(), because it doesn't work better in presettings.
Where am I supposed to insert it to make it effective?
Link to comment
Share on other sites

  • 2 weeks later...
Hi Sebastien,
take the normal PiWeb protocol an do not print. In the postsettings you can activate the compactProtocol for printing.

status = inspectionToleranceState().asString

if status == "outOfTolerance"
	defineProtocol("#name","default_compressed_tolicon")
	defineProtocol("#type","compactProtocol")
	defineProtocol("#medium","printer")
	defineProtocol("#elements","allCFOutTol")
	defineProtocol("#order","likeList")
else
	defineProtocol("#name","default_compressed_tolicon")
	defineProtocol("#type","compactProtocol")
	defineProtocol("#medium","screen")
	defineProtocol("#elements","allCF")
	defineProtocol("#order","likeList")
endif
I hope this will help.
Link to comment
Share on other sites

Hallo Sebastien,

hast du folgenden Code in den Ausgangsparametern des Prüfplans probiert?


if inspectionToleranceState() == "outOfTolerance" then
endInspection("NO_DATA_OUTPUT",1)
endif


Der endInspection()-Befehl beendet den Ablauf ordnungsgemäß (während der Zusatz die Protokollausgabe verhindert), im Gegensatz zu cncBreak(), welcher den Ablauf unterbricht.

Gruß
Jens
Link to comment
Share on other sites

Please sign in to view this quote.

Hi Reiner, this wouls surely work, but we need to print the PiWeb multiple report with its graphical output.

Please sign in to view this quote.

Hi Jens, this is new to me. It works to deactivate the protocol output, but it also deactivates every other output. The problem is that I also need the .txt file to transfer the data to our production tracking system.

I think it's a pity that for such a simple problem, there is no simple solution!
Link to comment
Share on other sites

  • 2 weeks later...
Here is a work around.
The following will be in a batch file called "report_end.bat". The batch file will reside in the measurement plan directory if you are only concerned with the individual program. If you want to use it for all of your programs, put the file in the inspections folder.
You will need to install Ghostscript to print the pdf.
There are a few lines that may need to be edited, depending on your system.
" C:\Users\Public\Documents\Zeiss\CALYPSO\workarea\results" will be the results directory defined by the "Paths" tab in the "System settings: Environment" window.
"C:\Program Files\gs\gs9.53.3\bin\gswin64c.exe" in the last line might need to be edited based on the location of Ghostscript
"\\ca-printsrv\(South-MillPod-2ndFloor) Lexmark C2240", in the last line, is the network path to the printer


@ECHO OFF

setLocal EnableDelayedExpansion

C:

CD C:\Users\Public\Documents\Zeiss\CALYPSO\workarea\results

REM Read file to determine the tolerance state of the Calypso report
for /f "tokens=* delims=" %%a in ('type tolState.txt') do (
	set tolState1=%%a
)

REM Retrieve the path of the pdf file generated by Calypso
for /f "tokens=* delims=" %%a in ('type protocolLogPath.txt') do (
	set "protLogPath1=%%a\protocols.log"
)

REM Set the pdf path retrieved from the protocols log file to the pdfPath environment variable
for /f "tokens=*" %%a in ('find ".pdf" "%protLogPath1%"') do set "pdfPath=%%a"

REM Check to see if report should be printed
if %tolState1%==outOfTolerance (
	ECHO printing
	"C:\Program Files\gs\gs9.53.3\bin\gswin64c.exe" -sDEVICE=mswinpr2 -dBATCH -dNOPAUSE -sOutputFile="\\spool\\\ca-printsrv\(South-MillPod-2ndFloor) Lexmark C2240" "%pdfPath%"
)
The following will be in the Pre and Post settings in Calypso
Presettings=================================================================

protocolLogPath = directoryPath("actuals") 
resultsPath = directoryPath("results") + "\"

if fileExists(resultsPath + "protocolLogPath.txt")
 	deleteFile(resultsPath + "protocolLogPath.txt")
endif

addToFile(resultsPath + "protocolLogPath.txt", protocolLogPath)
Postsettings=================================================================

tolState=inspectionToleranceState()
if fileExists(resultsPath + "tolState.txt")
         deleteFile(resultsPath + "tolState.txt")
endif

addToFile(resultsPath + "tolState.txt", tolState)
Link to comment
Share on other sites

Thank you Walter, it looks like a pretty good solution for me!
I'll just have to find an IT guy who has some time for me... 🙄
I'll give you a feedback as soon as I've done some tests
Link to comment
Share on other sites

 Share

×
×
  • Create New...