Overview

These script functions are used to execute the analysis specified in the parameters.

Method Options


Description

Execute and returns the results for the analysis specified in the parameters.

Syntax

system.mes.analysis.executeAnalysis(beginDate, endDate, settings)


  • Parameters

Date beginDate - Date object containing the beginning date to based the analysis results on.

Date endDate - Date object containing the ending date to based the analysis results on.

MESAnalysisSettings settings - MESAnalysisSettings object containing the data points, filter expressions, group by, order by, etc. setting to return the results for.

  • Returns

MESAnalysisResults - A MESAnalysisResults object containing the results of the analysis that was returned. (See MESAnalysisResults in the manual for more details.)

  • Scope

All

Code Examples
Code Snippet
##Execute the "Downtime" Analysis Settings and print the dataset object.
sasName = 'Downtime'
obj = system.mes.analysis.getMESAnalysisSettings(sasName)
end = system.date.now()
start = system.date.addDays(end, -2)
result = system.mes.analysis.executeAnalysis(start, end, obj)
print result.getDataset()  
Output
Dataset [5R x 12C] 
Description

Execute and returns the results for the analysis specified in the parameters.

Syntax

system.mes.analysis.executeAnalysis(beginDate, endDate, settings)


  • Parameters

Date beginDate - Date object containing the beginning date to based the analysis results on.

Date endDate - Date object containing the ending date to based the analysis results on.

MESAnalysisSettings settings - MESAnalysisSettings object containing the data points, filter expressions, group by, order by, etc. setting to return the results for.

PyUser user - User object obtained by calling system.user.getUser(). This is optional and only available if calling this script from a Gateway Context, such as when doing analysis in a tag change event script or similar. If a user is passed in, their security settings will be used. If a user is not passed in and the script is executing from a Gateway Event script, analysis security settings will not be applied.

  • Returns

MESAnalysisResults - A MESAnalysisResults object containing the results of the analysis that was returned. (See MESAnalysisResults in the manual for more details.)

  • Scope

All

Code Examples
Code Snippet
##Execute the "Downtime" Analysis Settings and print the dataset object.
sasName = 'Downtime'
obj = system.mes.analysis.getMESAnalysisSettings(sasName)
end = system.date.now()
start = system.date.addDays(end, -2)
user = system.user.getUser('UserSource', 'UserName')
result = system.mes.analysis.executeAnalysis(start, end, obj, user)
print result.getDataset()  
Output
Dataset [5R x 12C] 
Description

Execute and returns the results for the analysis specified in the parameters.

Syntax

system.mes.analysis.executeAnalysis(beginDate, endDate, settings, parameters)


  • Parameters

Date beginDate - Date object containing the beginning date to based the analysis results on.

Date endDate - Date object containing the ending date to based the analysis results on.

MESAnalysisSettings settings - MESAnalysisSettings object containing the data points, filter expressions, group by, order by, etc. setting to return the results for.

PyDictionary parameters - A PyDictionary containing name / value pairs for each parameter that exists in the analysis settings.

  • Returns

MESAnalysisResults - A MESAnalysisResults object containing the results of the analysis that was returned. (See MESAnalysisResults in the manual for more details.)

  • Scope

All

Code Examples
Code Snippet
##Execute the "Downtime" Analysis Settings and print the dataset object.
sasName = 'Downtime'
obj = system.mes.analysis.getMESAnalysisSettings(sasName)
end = system.date.now()
start = system.date.addDays(end, -2)
eqPath = '[global]\Dressings Inc\California\Raw Materials\Unload Station 1'
params = {'EqPath' : eqPath, 'PackageCount' : 1.0}
result = system.mes.analysis.executeAnalysis(start, end, obj, params)
print result.getDataset() 
Output
Dataset [3R x 12C]
Description

Execute and returns the results for the analysis specified in the parameters.

Syntax

system.mes.analysis.executeAnalysis(beginDate, endDate, settings, parameters)


  • Parameters

Date beginDate - Date object containing the beginning date to based the analysis results on.

Date endDate - Date object containing the ending date to based the analysis results on.

MESAnalysisSettings settings - MESAnalysisSettings object containing the data points, filter expressions, group by, order by, etc. setting to return the results for.

PyDictionary parameters - A PyDictionary containing name / value pairs for each parameter that exists in the analysis settings.

PyUser user - User object obtained by calling system.user.getUser(). This is optional and only available if calling this script from a Gateway Context, such as when doing analysis in a tag change event script or similar. If a user is passed in, their security settings will be used. If a user is not passed in and the script is executing from a Gateway Event script, analysis security settings will not be applied.

  • Returns

MESAnalysisResults - A MESAnalysisResults object containing the results of the analysis that was returned. (See MESAnalysisResults in the manual for more details.)

  • Scope

All

Code Examples
Code Snippet
##Execute the "Downtime" Analysis Settings and print the dataset object.
sasName = 'Downtime'
obj = system.mes.analysis.getMESAnalysisSettings(sasName)
end = system.date.now()
start = system.date.addDays(end, -2)
eqPath = '[global]\Dressings Inc\California\Raw Materials\Unload Station 1'
params = {'EqPath' : eqPath, 'PackageCount' : 1.0}
user = system.user.getUser('UserSource', 'UserName')
result = system.mes.analysis.executeAnalysis(start, end, obj, params, user)
print result.getDataset() 
Output
Dataset [3R x 12C]
Description

Execute and returns the results for the analysis specified in the parameters.

Syntax

system.mes.analysis.executeAnalysis(beginDate, endDate, savedSettingsName)


  • Parameters

Datatype - Date object containing the beginning date to based the analysis results on.

Datatype - Date object containing the ending date to based the analysis results on.

String savedSettingsName - The name of the saved analysis settings to execute and return the results for. 

  • Returns

MESAnalysisResults - A MESAnalysisResults object containing the results of the analysis that was returned. (See MESAnalysisResults in the manual for more details.)

  • Scope

All

Code Examples
Code Snippet
##Execute the "Downtime" Analysis Settings and print the dataset object.
sasName = 'Downtime'
obj = system.mes.analysis.getMESAnalysisSettings(sasName)
end = system.date.now()
start = system.date.addDays(end, -2)
result = system.mes.analysis.executeAnalysis(start, end, sasName)
print result.getDataset() 
Output
Dataset [5R x 12C]  
Description

Execute and returns the results for the analysis specified in the parameters.

Syntax

system.mes.analysis.executeAnalysis(beginDate, endDate, savedSettingsName)


  • Parameters

Datatype - Date object containing the beginning date to based the analysis results on.

Datatype - Date object containing the ending date to based the analysis results on.

String savedSettingsName - The name of the saved analysis settings to execute and return the results for. 

PyUser user - User object obtained by calling system.user.getUser(). This is optional and only available if calling this script from a Gateway Context, such as when doing analysis in a tag change event script or similar. If a user is passed in, their security settings will be used. If a user is not passed in and the script is executing from a Gateway Event script, analysis security settings will not be applied.

  • Returns

MESAnalysisResults - A MESAnalysisResults object containing the results of the analysis that was returned. (See MESAnalysisResults in the manual for more details.)

  • Scope

All

Code Examples
Code Snippet
##Execute the "Downtime" Analysis Settings and print the dataset object.
sasName = 'Downtime'
obj = system.mes.analysis.getMESAnalysisSettings(sasName)
end = system.date.now()
start = system.date.addDays(end, -2)
user = system.user.getUser('UserSource', 'UserName')
result = system.mes.analysis.executeAnalysis(start, end, sasName, user)
print result.getDataset() 
Output
Dataset [5R x 12C]  
Description

Execute and returns the results for the analysis specified in the parameters.

Syntax

system.mes.analysis.executeAnalysis(beginDate, endDate, savedSettingsName, parameters)


  • Parameters

Datatype - Date object containing the beginning date to based the analysis results on.

Datatype - Date object containing the ending date to based the analysis results on.

String savedSettingsName - The name of the saved analysis settings to execute and return the results for. 

PyDictionary parameters - A PyDictionary containing name / value pairs for each parameter that exists in the analysis settings.

  • Returns

MESAnalysisResults - A MESAnalysisResults object containing the results of the analysis that was returned. (See MESAnalysisResults in the manual for more details.)

  • Scope

All

Code Examples
Code Snippet
##Execute the "Downtime" Analysis Settings and print the dataset object.
sasName = 'Downtime'
obj = system.mes.analysis.getMESAnalysisSettings(sasName)
end = system.date.now()
start = system.date.addDays(end, -2)
eqPath = '[global]\Dressings Inc\California\Raw Materials\Unload Station 1'
params = {'EqPath' : eqPath, 'PackageCount' : 1.0}
result = system.mes.analysis.executeAnalysis(start, end, sasName, params)
print result.getDataset() 
Output
Dataset [3R x 12C]  
Description

Execute and returns the results for the analysis specified in the parameters.

Syntax

system.mes.analysis.executeAnalysis(beginDate, endDate, savedSettingsName, parameters)


  • Parameters

Datatype - Date object containing the beginning date to based the analysis results on.

Datatype - Date object containing the ending date to based the analysis results on.

String savedSettingsName - The name of the saved analysis settings to execute and return the results for. 

PyDictionary parameters - A PyDictionary containing name / value pairs for each parameter that exists in the analysis settings.

PyUser user - User object obtained by calling system.user.getUser(). This is optional and only available if calling this script from a Gateway Context, such as when doing analysis in a tag change event script or similar. If a user is passed in, their security settings will be used. If a user is not passed in and the script is executing from a Gateway Event script, analysis security settings will not be applied.

  • Returns

MESAnalysisResults - A MESAnalysisResults object containing the results of the analysis that was returned. (See MESAnalysisResults in the manual for more details.)

  • Scope

All

Code Examples
Code Snippet
##Execute the "Downtime" Analysis Settings and print the dataset object.
sasName = 'Downtime'
obj = system.mes.analysis.getMESAnalysisSettings(sasName)
end = system.date.now()
start = system.date.addDays(end, -2)
eqPath = '[global]\Dressings Inc\California\Raw Materials\Unload Station 1'
params = {'EqPath' : eqPath, 'PackageCount' : 1.0}
user = system.user.getUser('UserSource', 'UserName')
result = system.mes.analysis.executeAnalysis(start, end, sasName, params, user)
print result.getDataset() 
Output
Dataset [3R x 12C]  






  • No labels