Jump to content

PCM; If characteristic reports out of tolerance then add results to a file


---
 Share

Recommended Posts

I need some help. I want to keep a running log of features that report out of tolerance for selected programs. The goal is to add a line to a text file every time a characteristic reports out of tolerance. I have had success using addtofile inside of an individual characteristic to accomplish this. For example, placing the PCM in the post settings of the characteristic. The problem is copying this code to every single characteristic is too labor intensive.

I know I can do this using an end.bat file or in the postsettings of the program, but I can't figure out the syntax that I need.

Can anyone help me?
Link to comment
Share on other sites

One possibility that creates a file in the results folder.
myFile=getRESULTS()+"\"+"Failed Characteristics.txt"
cfList=baseSystem().machine.inspection.allControlFeatureNames.asList
for i = 1 to cfList.size
myName=getParameterNamed(cfList,i)
if text(getActual(myName).toleranceState) == "outOfTolerance"
addToFile(myFile,myName)
endif
next i
Link to comment
Share on other sites

 Share

×
×
  • Create New...