MES Analysis Settings

Sepasoft MES Module Suite

MESAnalysisSettings Object

The MESAnalysisSettings object is used to store configuration for analysis including individual data points, filter expressions, grouping, ordering, and data conditioning settings are stored in this object. 

By calling the analysis engine and executing against the configured settings, result data is returned to the user as requested.

Inherits properties, methods and events from:

Object Creation

The following scripting functions can be used to create or return an MES Analysis Settings object:


Use

The following components use the MESAnalysisSettings object:

  • MES Analysis Selector

  • MES Analysis Controller

  • Ignition Reporting Module's Report Editor Data Tab

Object Functions


 

addParameter(parameterName)

Description

Adds a parameter to the analysis settings.

Syntax

addParameter(parameterName)

  • Parameters

String parameterName - Name of the parameter to be added.

  • Returns

Nothing

  • Scope

All

 

addSecurityRole(roleName)

Description

Adds a security role to the analysis settings.

Syntax

addSecurityRole(roleName)

  • Parameters

String roleName - Name of security role to be added.

  • Returns

Nothing

  • Scope

All

 addSettingValue(settingName)

Description

Adds a setting value to the analysis settings object.  This setting can modify the analysis data with specific conditioning such as ordering, limits, or count accumulation to give some of the many options.  See Analysis Data Points and Settings > Setting Values

Syntax

addSettingValue(settingName)

  • Parameters

String settingName - Name of the setting to be added.

  • Returns

Nothing

  • Scope

All

Example Script
Python
##Load the analysis setting object into local memory
                    
analysisSettingObject = system.mes.analysis.getMESAnalysisSettings('OEE')
                    
##Add a setting that modifies the analysis result-set, in this case an OEE Performance factor cap.
                    
analysisSettingObject.addSettingValue('OEE Performance Cap')
                    
##Save the analysis setting object with the updated settings.
                    
system.mes.analysis.saveMESAnalysisSettings(analysisSettingObject)

 

addSettingValue(settingName, settingValue)

Description

Adds a setting value to the analysis settings. This setting can modify the analysis data with specific conditioning such as ordering, limits, or count accumulation to give some of the many options.  More details on the available setting values can be found here.

Syntax

addSettingValue(settingName, settingValue)

  • Parameters

String settingName - Name of the setting to be added.

String settingValue - Value of the setting to be added.

  • Returns

Nothing

  • Scope

All

Example Script
Python
##Load the analysis setting object into local memory
                    
analysisSettingObject = system.mes.analysis.getMESAnalysisSettings('OEE')
                    
##Add a setting that modifies the analysis result-set, in this case an OEE Performance factor cap.
                    
analysisSettingObject.addSettingValue('OEE Performance Cap''1.0')
                    
##Save the analysis setting object with the updated settings.
                    
system.mes.analysis.saveMESAnalysisSettings(analysisSettingObject)

 

canUserExecute(user)

Description

Checks whether an MES user is allowed to execute the analysis settings.

Syntax

canUserExecute(user)


  • Parameters

MESUser user - The MES user for which the canUserExecute property is checked for.

  • Returns

boolean-True if the MES user can execute analysis settings and False otherwise.

  • Scope

All

 

canUserModify(user)

Description

Checks whether an MES user is allowed to modify the analysis settings.

Syntax

canUserModify(user)


  • Parameters

MESUser user - The MES user for which the canUserModify property is checked for.

  • Returns

boolean-True if the MES user can modify analysis settings and False otherwise.

  • Scope

All

 

clearSettingValue()

Description

Removes the value of analysis settings.

Syntax

clearSettingValue()

  • Parameters

None

  • Returns

Nothing

  • Scope

All

 getDataPointList()

Description

 Gets the list of data points associated with the analysis settings.

Syntax

getDataPointList()


  • Parameters

 None

  • Returns

 List<String> dataPointList - A list of data points for the analysis settings.

  • Scope

All

 

getDataPoints()

Description

 Gets the data points associated with the analysis settings.

Syntax

getDataPoints()

  • Parameters

 None

  • Returns

 String dataPoints - Data points for the analysis settings.

  • Scope

All

 

getEndDateParameterName()

Info

Analysis data can be filtered using Ignition report parameters. They can be selected from the drop down menu of the analysis sector (only for reports) as shown below.



Description

Gets the end date parameter name for the MES analysis.

Syntax

getEndDateParameterName()

  • Parameters

None

  • Returns

String parameterName - The end date parameter name for the MES analysis (reports).

  • Scope

All

 getFilterExpression()

Description

 Gets the filter expression for the analysis settings.

Syntax

getFilterExpression()

  • Parameters

None

  • Returns

String expression - The filter expression for the analysis settings. 

  • Scope

All

 

getGroupBy()

Description

Gets the GroupBy for this analysis settings.

Syntax

getGroupBy()

  • Parameters

None

  • Returns

String groupBy - GroupBys defined in the analysis settings.

  • Scope

All

 

getGroupByList()

Description

Gets the list of GroupBys defined in the analysis settings.

Syntax

getGroupByList()

  • Parameters

None

  • Returns

List<String> groupByList - The list of GroupBys defined in the analysis settings.

  • Scope

All

 

getIncludeDrillDownOptions()

Description

Gets the includeDrillDownOptions property value for the analysis settings.

Syntax

getIncludeDrillDownOptions()

  • Parameters

None

  • Returns

boolean includeOptions - True if the drill down options are included and False otherwise.

  • Scope

All

 getMessage()

Description

Gets the message from the analysis engine after executing the analysis settings.  Messages have error information if the analysis setting is malformed (e.g. data point name is spelled incorrectly, an equipment path is mis-typed, etc.) or if values in the result-set are null due to grouping configuration, etc.

Syntax

getMessage()

  • Parameters

None

  • Returns

String message - The message from the analysis engine based on the analysis setting execution.

  • Scope

All

 

getOrderBy()

Description

Gets the OrderBys defined in the analysis settings.

Syntax

getOrderBy()

  • Parameters

None

  • Returns

String orderBy - The OrderBys defined in the analysis data.

  • Scope

All

 

getOrderByList()

Description

Gets the list of OrderBys defined in the analysis settings.

Syntax

getOrderByList()


  • Parameters

None

  • Returns

List<String> orderByList - The list of OrderBys defined in the analysis settings.

  • Scope

All

 

getOwnerUserName()

Description

Gets the name of user who owns this analysis settings.

Syntax

getOwnerUserName()

  • Parameters

None

  • Returns

String userName - Name of the owner of this setting.

  • Scope

All

 

getParameterCount()

Description

Gets the number of parameter for the analysis settings.

Syntax

getParameterCount()

  • Parameters

None

  • Returns

int  count - The parameter count for the analysis settings.

  • Scope

All

 

getParameter(index)

Description

Gets the analysis parameter corresponding to the given index.

Syntax

getParameter(index)

  • Parameters

int index - The index representing the parameter.

  • Returns

AnalysisParameterProperty analysisParameter - The analysis parameter complex property defined by the specified index.

  • Scope

All

 

getParameter(parameterName)

Description

Gets the analysis parameter.

Syntax

getParameter(parameterName)

  • Parameters

String parameterName - The name of the parameter to be returned.

  • Returns

AnalysisParameterProperty analysisParameter - The analysis parameter complex property.

  • Scope

All

 

getSecurityRoleCount()

Description

Gets the security role count for the analysis settings.

Syntax

getSecurityRoleCount()

  • Parameters

None

  • Returns

int count - The count of security roles associated with this analysis settings.

  • Scope

All

 

getSecurityRole(index)

Description

Gets the security role corresponding to the index parameter.

Syntax

getSecurityRole(index)

  • Parameters

int index - The security role index.

  • Returns

AnalysisSecurityProperty analysisSecurity - The analysis security complex property with the security role details.

  • Scope

All

 getSecurityRole(roleName)

Description

Gets the security role corresponding to the role name parameter.

Syntax

getSecurityRole(roleName)

  • Parameters

String roleName - The role name to return the security role for.

  • Returns

AnalysisSecurityProperty analysisSecurity - The analysis security complex property with the security role details.

  • Scope

All

 

getSettingValues()

Description

Returns the Analysis Data Points and Settings > Setting Values for the Analysis Settings object. These are settings that modify the analysis settings or configuration.

Syntax

getSettingValues()

  • Parameters

None

  • Returns

String settingValues - The Setting Values for the Analysis Settings object. More details on the available setting values can be found here.

  • Scope

All

Scripting Example
Python
##Load the analysis settings object into local memory.
                    
analysisSettingObject = system.mes.analysis.getMESAnalysisSettings('OEE')
                    
##Get the settings on the analysis settings object.
                    
settings = analysisSettingObject.getSettingValues()
                    
print settings

Output

Include Children=True,OEE Performance Cap=1.0

 

getStartDateParameterName()

Info

Analysis data can be filtered using Ignition report parameters. They can be selected from the drop down menu of the analysis sector (only for reports).


Description

Gets the start date parameter name from the MES analysis (report).

Syntax

getStartDateParameterName()

  • Parameters

None

  • Returns

String parameterName - The start date parameter defined in the MES analysis.

  • Scope

All

 

hasDataPoints()

Description

 Checks whether there exist any data points for the analysis settings.

Syntax

hasDataPoints()

  • Parameters

 None

  • Returns

boolean - True if there exist any data points for the analysis settings and False otherwise.

  • Scope

All

 

removeParameter(parameterName)

Description

Removes the specific parameter from the analysis settings.

Syntax

removeParameter(parameterName)

  • Parameters

String parameterName - Name of the parameter to be removed.

  • Returns

Nothing

  • Scope

All

 

removeSecurityRole(roleName)

Description

Removes a security role from the analysis settings.

Syntax

removeSecurityRole(roleName)

  • Parameters

String roleName - The name of security role that is to be removed.

  • Returns

Nothing

  • Scope

All

 

setDataPoints(dataPoints)

Description

 Sets the data points for this analysis settings.

Syntax

setDataPoints(dataPoints)

  • Parameters

List<String> dataPoints - The data points to set for the analysis settings. Ensure dataPoints is a list of strings.

  • Returns

Nothing

  • Scope

All

Code Sample
analysis_setting = system.mes.analysis.createMESAnalysisSettings("test_setting")
datapoints = [
            "Elapsed Time",
            "OEE Availability",
            "Runtime",
            "Planned Downtime",
            "Infeed Standard Count",
            "OEE Performance",
            "OEE Infeed Count",
            "OEE Quality",
            "OEE Reject Count",
            "OEE Outfeed Count",
            "Equipment Operation Sequence"
            ]
analysis_setting.setDataPoints(datapoints)
analysis_setting.addParameter('path')
analysis_setting.setFilterExpression("Equipment Path = @path AND Operation UUID != ''")
analysis_setting.setGroupBy("Equipment Operation Sequence")
 
start_date = system.date.addYears(system.date.now(), -1)
end_date = system.date.now()
params = {'path':'\\Enterprise\Site\Area\Line 3'}
print system.mes.analysis.executeAnalysis(start_date, end_date, analysis_setting, params).getDataset()
 

setEndDateParameterName(parameterName)

Info

Analysis data can be filtered using Ignition report parameters. They can be selected from the drop down menu of the analysis sector (only for reports).

Description

Sets the end date parameter name for the MES analysis settings (reports).

Syntax

setEndDateParameterName(parameterName)


  • Parameters

String parameterName - The end date parameter name to set for the analysis settings.

  • Returns

Nothing

  • Scope

All

 

setFilterExpression(expression)

Description

 Sets the filter expression for the analysis settings.

Syntax

setFilterExpression(expression)

  • Parameters

String expression - The filter expression to be set for. 

  • Returns

Nothing

  • Scope

All

setFilterBy()
Python
settings = system.mes.analysis.createMESAnalysisSettings("test_setting")
                    
settings.setFilterExpression("""Equipment Path LIKE 'Enterprise\\Site\\OEE Area\\Packaging Line 1\\* AND
                    
Equipment State Type != 'Running' AND Equipment State Type != 'Unplanned Downtime'""")

 

setGroupBy(groupBy)

Description

Sets the GroupBy to group the analysis data.

Syntax

setGroupBy(groupBy)

  • Parameters

String groupBy - The factors to group the analysis data.

  • Returns

Nothing

  • Scope

All

 

setGroupBy(groupBy)

Description

Sets the factors (GroupBy) to group the analysis data.

Syntax

setGroupBy(groupBy)


  • Parameters

List<String> groupBy - The list of GroupBys separated by commas.

  • Returns

Nothing

  • Scope

All

 

setIncludeDrillDownOptions(includeOptions)

Description

Sets the includeDrillDownOptions property value for the analysis settings.

Syntax

setIncludeDrillDownOptions(includeOptions)


  • Parameters

boolean includeOptions - Set to True if you like to include the drill down options and False otherwise.

  • Returns

Nothing

  • Scope

All

 

setOrderBy(orderBy)

Description

Sets the OrderBy for the analysis data.

Syntax

setOrderBy(orderBy)

  • Parameters

String orderBy - The orderBy to set for the analysis data.

  • Returns

Nothing

  • Scope

All

 

setOrderBy(orderBy)

Description

Sets a list of OrderBys for the analysis data.

Syntax

setOrderBy(orderBy)


  • Parameters

List<String> orderBy - The list of OrderBys for the analysis data.

  • Returns

Nothing

  • Scope

All

 

setParameterDataType(parameterName, parameterDataType)

Description

Sets the datatype for the analysis parameter.

Syntax

setParameterDataType(parameterName, parameterDataType)

  • Parameters

String parameterName - Name of the parameter to set the data type for.

String parameterDataType - Data type to set for the parameter.

  • Returns

Nothing

  • Scope

All

 

setSecurityRoleRights(roleName, canExecute, canModify)

Description

Sets the rights to security role.

Syntax

setSecurityRoleRights(roleName, canExecute, canModify)

  • Parameters

String roleName - The name of the security role to set the security rights for.

boolean canExecute - Set to True if this security role can execute the analysis and False otherwise.

boolean canModify - Set to True if this security role can modify the analysis and False otherwise.

  • Returns

Nothing

  • Scope

All

 setSettingValues(settingValues)

Description

Sets values for the analysis settings.  These settings can modify the analysis data with specific conditioning such as ordering, limits, or count accumulation to give some of the many options.  See Analysis Data Points and Settings > Setting Values.

Syntax

setSettingValues(settingValues)

  • Parameters

List<String> settingValues - The values to set for.

  • Returns

Nothing

  • Scope

All

Example Script
Python
##Load the analysis setting object into local memory.
                    
analysisSettingObject = system.mes.analysis.getMESAnalysisSettings('OEE')
                    
##Get the settings on the analysis settings object.
                    
settings = analysisSettingObject.getSettingValues()
                    
##Since the analysis setting's settings are a string, append an additional setting to the string.
                    
settings += ',OEE Performance Cap=1.0'
                    
##Set the updated setting string on the analysis setting object.
                    
analysisSettingObject.setSettingValues(settings)
                    
##Save the analysis setting object.
                    
system.mes.analysis.saveMESAnalysisSettings(analysisSettingObject)


Sepasoft MES Module Suite