Configure SPC Analysis in Script
Create a new view SPC_03_Scripting/Reporting
The Reporting page has two components:

Configure 'Generate SPC Data' Button
- Drag an Ignition Button component onto the middle of the window. Resize it enough to fit the text shown above.
- Change the Text property to Generate SPC Data.
RIght-click the button , select Configure Events, select the onActionPerformed event script area and paste in the script below (change the date range, if necessary, to span your data entries)
Python |
def runAction(self, event): ##Configure an Analysis Setting within script end = system.date.now() begin = system.date.addHours(end, -8) analysis = system.mes.analysis.createMESAnalysisSettings('analysis') analysis.setDataPoints("Dimension Sample B-Diameter.SampleUUID,Dimension Sample B-Diameter.Sample Value,Dimension Sample B-LocationX.Sample Value,Dimension Sample B-LocationY.Sample Value") analysis.setFilterExpression("Equipment Path = 'New Enterprise\Site\Area\Line 1\Test Location'") analysis.setGroupBy("Dimension Sample B-Diameter.SampleUUID") results = system.mes.analysis.executeAnalysis(begin, end, analysis) # getDataset() returns an Ignition Dataset # For documentation, see: https://docs.inductiveautomation.com/display/DOC79/Datasets dataset = results.getDataset() ###Example of calling a previously existing Analysis Setting. #endDate = system.date.now() #beginDate = system.date.addDays(endDate, -3) #results = system.mes.analysis.executeAnalysis(beginDate, endDate, 'Door Placement') self.getSibling("Table").props.data = dataset |