Configure Settings Recipe Report
- Create a new Report in the Reporting section of the Project Browser, and name the report Recipe Variance Report.
- Create Parameters for:
Add the script Variance Report Script at the bottom of this page for the Variance Report in a Script data source.
- Create a table and drag values from the script data source to the table for columns of Recipe Name, From Value, and To Value.
- Extend the report with text labels for Recipe Name, StartDate, EndDate, and Title.
Variance Report Script
Code |
settings = system.production.createAnalysisSettings()
settings.setAnalysisProvider("Recipe Variance")
settings.addFilter("StartDate", system.db.dateFormat(data["StartDate"], "yyyy-MM-dd HH:mm:ss"))
settings.addFilter("EndDate", system.db.dateFormat(data["EndDate"], "yyyy-MM-dd HH:mm:ss"))
#Because we may have multiple recipes running on a line, the 'Include children' setting doesn't seem to work, so we will add all children to the Item Path filter.
filter = system.mes.object.filter.createFilter()
filter.setMESObjectTypeName('LineCell')
filter.setPrimaryMESObjectPath(data["ItemPath"])
list = system.mes.searchMESObjects(filter)
for ndx in range(list.size()):
mesObject = list.get(ndx).getMESObject()
settings.addFilter("Item Path", mesObject.getEquipmentPath())
settings.addFilter("Item Path", data["ItemPath"])
settings.addFilter("Values", "Changed Values")
# settings.addFilter("Scope", "Date Range")
settings.addFilter("Recipe Name", data["RecipeName"])
if data["Children"]:
settings.addFilter("Children", "Include")
else:
settings.addFilter("Children", "Exclude (Default)")
settings.addDataPoint("Recipe Name")
settings.addDataPoint("Value Name")
settings.addDataPoint("Item Path")
settings.addDataPoint("Time Stamp")
settings.addDataPoint("From Value")
settings.addDataPoint("To Value")
results = system.production.getAnalysisResults(settings)
data['Data'] = results.getTableResults() |