Evaluate Variance Script

Sepasoft MES Module Suite

Evaluate Variance Script

If the Evaluate Variance Script property of a production item contains a script, it will be executed every time an Ignition tag associated with a recipe value changes.

Variance monitoring must also be active. When it is executed, the event object provides information about the recipe value being evaluated.

If event.setLogVariance(logVariance) is not called, then the log variance state determined before this event will be used.

See Recipe Values Settings > Enable Variance Logging.

Properties

getCurrentValue()

Description

Get the current recipe value change.

Syntax

getCurrentValue()


  • Parameters

None

  • Returns

Object currentValue - The live recipe value after the change occurred.

getPreviousValue()

Description

Get the last recorded recipe value change.

Syntax

getPreviousValue()


  • Parameters

None

  • Returns

Object previousValue - The live recipe value before the change occurred.

getRecipeTag()

Description

Get the tag associated with the recipe value being evaluated.

Syntax

getRecipeTag()


  • Parameters

None

  • Returns

RecipeTag tag - An instance of a RecipeTag.

getScale()

Description

Return the scale factor for the MES production item associated with the recipe value being evaluated.

Syntax

getScale()


  • Parameters

None

  • Returns

Double scale - The scale factor associated with the evaluated recipe value.

getSetPoint()

Description

Get the recipe setpoint's value. This is the target value set by the recipe.

Syntax

getSetPoint()


  • Parameters

None

  • Returns

Object setpointValue - The target setpoint tag value for this recipe value.

isLogVariance()

Description

Get the is log variance flag for the recipe value being evaluated.

Syntax

isLogVariance()


  • Parameters

None

  • Returns

boolean logVariance - True is returned if recipe value being evaluated is outside of the configured variance settings and False otherwise.

setLogVariance()

Description

Set the variance flag for the recipe value being evaluated. Use to override the current state of the variance flag.

Syntax

setLogVariance()


  • Parameters

boolean logVariance - True to flag recipe value as in variance, else return false.

  • Returns

Nothing

Code Example

Python
upperLimit = system.tag.read("[Default]UpperLimit")
lowerLimit = system.tag.read("[Default]LowerLimit")
recipeValue = event.getRecipeTag().getCurrentValue()
if recipeValue > upperLimit.value or recipeValue < lowerLimit.value:
 event.setLogVariance(True)
else:
 event.setLogVariance(False)




Sepasoft MES Module Suite