Jump to content

Overall Result command in PCM


---
 Share

Recommended Posts

I need to get some info from the "Overall Result", maybe a 1 or 0 output saying everything is good or something is bad.
I want to use it in an if statement, so my text file gets sent to Winspc if everything's good, and ill launch a text box saying "Warning, something is out of tol" if 1 or more things are bad, and not send the text report.
I know how to do everything so far, i just don't know if there is a command that lets me know if everything is good or not in PCM.
Link to comment
Share on other sites

Hi Roberto,

with inspectionToleranceState() u can check it, but u dont get 1 or 0 back.

possible answers are:
notDefinded
inTolerance
outOftolerance
outOfLimit.

but it should work for u too.
Link to comment
Share on other sites

That worked great Eric
i was able to turn "inspectionToleranceState()" into a number with "len()" command.
so since "outOfTolerance" is 14 characters, it has a value of 14.
InTolerance has a value of 11, but i'm not even going to bother with that.
I just made a simple If statement so that if something is out then the PCM wipes out the text file from the SPC folder and throws a comment up for the operator.

Len=len(inspectionToleranceState())
if Len == 14 then
deleteFile(dirPath)
message("SOMETHING IS OUT OF TOL"+cr()+"TEXT REPORT NOT SENT TO WINSPC")
endif
Link to comment
Share on other sites

I had nothing to do with that.. 🙂

But you can make it more efficient,
inspectionToleranceState() <> "inTolerance"
It might respond with a symbol maybe? In that case "#inTolerance".

Thats more memory efficient since the variable Len is never stored in cache.
Link to comment
Share on other sites

Not sure about this one but for example getRunID() will sometimes present #complete instead of "complete" when running CNC-mode and I suspect it can be the same with inspectionToleranceState().

in that case you can use
text(inspectionToleranceState()) <> "inTolerance" and it will remake it as text-format and remove any # and other weird stuff.
If you don't want to bother with mixing upper and lower case you can use text(inspectionToleranceState()).asUppercase and it will convert the string into all upper case letters.
Link to comment
Share on other sites

The # actually isn't wired 🙂 Since its a setting, and just like most settings, it is working with symbols. It's uniqe and immutable. Just think about it, you send a message to accidentally change the value. Or create a other one, everything communicating with that object would then not operate as expected...

But yeah, Zeiss could have hade an effort to convert the output to a string litteral, since there is no real reason to use symbols in pcm.

Btw Henrik, back and working fulltime yet? I have applied for another job at Saab. And it would be nice to drain you of knowlage before I eventually leave my present job and The oppertunity dissapears. 🙂
Link to comment
Share on other sites

  • 3 weeks later...

Please sign in to view this quote.

You get a "0" (Zero) if all are in tolerance and some other value when out of tolerance.
If inspectionToleranceState() == "0" then (Do something)
else 
(Do something else)
"S:\CMM - Inspection Results & Zeiss Table Files_Vault\CMM-Inspection-PDF Files\"+getRecordHead("order")+"\"+getRecordHead  ("mfgdev")+"\"+getRecordHead("u_DBSWITCH")+"_"+getRecordHead("partnbinc")+"_"+inspectionToleranceState("outOfTolerance")+"_PiWeb.pdf"
Example file produced:
2B84401007-2_--_2020_A1_PiWeb_0.pdf (In tolerance)
2B84401007-2_--_2020_A1_PiWeb_1.pdf (1 characteristic out of tolerance)
2B84401007-2_--_2020_A1_PiWeb_5.pdf (5 characteristics out of tolerance)

I did not see this post and I am trying to do something similar.
if inspectionToleranceState() == "0"
path = ""S:\CMM - Inspection Results & Zeiss Table Files_Vault\CMM-Inspection-PDF Files Accept\"+getRecordHead("order")+"\"+getRecordHead  ("mfgdev")+"\"+getRecordHead("u_DBSWITCH")+"_"+getRecordHead("partnbinc")+"_PiWeb.pdf""
else
path = ""S:\CMM - Inspection Results & Zeiss Table Files_Vault\CMM-Inspection-PDF Files Reject\"+getRecordHead("order")+"\"+getRecordHead  ("mfgdev")+"\"+getRecordHead("u_DBSWITCH")+"_"+getRecordHead("partnbinc")+"_PiWeb.pdf""
endif
I havent been able to work out the PCM format yet.
viewtopic.php?f=21&t=1397
Link to comment
Share on other sites

Hopefully the little bit of code i posted on March 2 is good enough, because i've been adding that to the end of all my program codes for programs that report text files directly to WinSPC.
It seems to work, if its out of tol its Len=14, otherwise i don't have any secondary actions or things to do.
its just looking at 1 thing and that's it.
Link to comment
Share on other sites

 Share

×
×
  • Create New...