Machine Recipe Tag

Sepasoft MES Module Suite

Machine Recipe Tag

A RecipeTag object contains details about a recipe value. It reflects the properties that are configured in the designer when the recipe value was added plus some live information such as the current value.

Properties

convertAndScaleValue(value, scaleFactor)

Returns the value passed in the parameter in the correct data type for the recipe value with scaling.

Syntax

convertValue(value, scaleFactor)

Parameters

String value - The actual value to be scaled.

Double scaleFactor - The factor you have to multiply for each serving. Say you have a 10-serving (original number of servings) recipe that you want to scale down for six (desired number of servings) dinner guests. That’s 6 ÷ 10 or .6. Your conversion factor is 6. Simply multiply each ingredient by .6 to get the exact amount for the recipe. Do the same to scale up. For 12 servings of your 10-serving recipe, divide 12 by 10 to get a conversion factor of 1.2.

Returns

The converted value with the specified data type and scaling.


convertValue(value)

Returns the value passed in the parameter in the correct data type for the recipe value. If the recipe value is an Int4, then the string value passed in the value parameter will be converted to an Int4 data type and returned.

Syntax

convertValue(value)

Parameters

String value -The actual value of the recipe.

Returns

The converted value with the specified data type.


getCurrentValue()

Returns the tag value of a tag associated with a recipe value.

Syntax

getCurrentValue()

Parameters

None

Returns

The value associated with the specified recipe value.


getDataType()

Returns the data type of the tag associated with the recipe value.

Syntax

getDataType()

Parameters

None

Returns

The data type of recipe value tag.


getHighVarianceThresholdStatement()

Returns the high variance threshold statement that was entered for the recipe value entry. 

Syntax

getHighVarianceThresholdStatement()

Parameters

None

Returns

The high variance threshold statement for the specified recipe value.


getHighVarianceThresholdValue()

Returns the high variance threshold value. This is calculated after the tag value change is detected and is used for default handling for the log variance state. It is provided here as a convenience.

Syntax

getHighVarianceThresholdValue()

Parameters

None

Returns

The high variance threshold value for the specified recipe value.


getLowVarianceThresholdStatement()

Returns the low variance threshold statement that was entered for the recipe value entry.

Syntax

getLowVarianceThresholdStatement()

Parameters

None

Returns

The low variance threshold statement for the specified recipe value.


getLowVarianceThresholdValue()

Returns the low variance threshold value. This is calculated after the tag value change is detected and is used for default handling for the log variance state. It is provided here as a convenience.

Syntax

getLowVarianceThresholdValue()

Parameters

None

Returns

The low variance threshold value for the specified recipe value.


getPreviousValue()

Returns the previous value of the recipe value. Anytime the value of a tag associated with a recipe value changes, the previous value is saved internally. This is used for the changed from information in variance logging.

Syntax

getPreviousValue()

Parameters

None

Returns

The previously recorded value.


getRecipeValue()

Returns the recipe value. This can be the value that was entered in recipe editor, set using script or inherited from a parent.

Syntax

getRecipeValue()

Parameters

None

Returns

The recipe value.


getRecipeValue(scale)

Returns the recipe value adjusted by the scale parameter.

Syntax

getRecipeValue(scale)

Parameters

Double scale - The factor to be multiplied with the recipe value.

Returns

The recipe value after scaling.


getRecipeValueName()

Returns the name of the recipe value. This is the same name entered in the recipe value entry in the designer.

Syntax

getRecipeValueName()

Parameters

None

Returns

The name of the recipe value.


getTagPath()

Returns the Ignition tag path assigned to the recipe value. This is the tag path entered for the recipe value.

Syntax

getTagPath()

Parameters

None

Returns

The tag path of the recipe value.


hasCurrentValue()

Returns True if the recipe value has a value.

Syntax

hasCurrentValue()

Parameters

None

Returns

True, if the recipe value has a value.


hasHighVarianceThresholdStatement()

Returns True if a high variance threshold statement was entered for the recipe value.

Syntax

hasHighVarianceThresholdStatement()

Parameters

None

Returns

True, if there exist a high variance threshold statement for the specified recipe value.


hasLowVarianceThresholdStatement()

Returns True if a low variance threshold statement was entered for the recipe value.

Syntax

hasLowVarianceThresholdStatement()

Parameters

None

Returns

The low variance threshold value for the specified recipe value.


hasPreviousValue()

Returns True if a previous value has been recorded for the recipe value. 

Syntax

hasPreviousValue()

Parameters

None

Returns

True, if there exist a previously recorded value.


isVarianceMonitorEnabled()

Returns True if variance monitoring is enabled for the recipe value.

Syntax

isVarianceMonitorEnabled()

Parameters

None

Returns

True, if variance monitoring is enabled.


scaleValue(value, scaleFactor)

Scales and returns the value passed in the parameter in the same data type as the value parameter. 

Syntax

scaleValue(value, scaleFactor)

Parameters

String value - The actual value to be scaled.

Double scaleFactor - The factor you have to multiply for each serving. Say you have a 10-serving (original number of servings) recipe that you want to scale down for six (desired number of servings) dinner guests. That’s 6 ÷ 10 or .6. Your conversion factor is 6. Simply multiply each ingredient by .6 to get the exact amount for the recipe. Do the same to scale up. For 12 servings of your 10-serving recipe, divide 12 by 10 to get a conversion factor of 1.2.

Returns

The value with the same data type as the value parameter.

Code Snippets

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




Sepasoft MES Module Suite