ScriptRecipeManagerObject

class ScriptRecipeManagerObject.LoadRecipeMode(value)

Bases: Enum

This enumeration represents the way how recipes are loaded.

Version added:

4.2.0.0

load_exactly_only = 0

Loads the recipe only when all recipe variables are available and in the right order in the recipe file (default)

load_by_variablename = 1

Loads those values from the recipe file where an according variable is in the recipe

class ScriptRecipeManagerObject.WriteRecipeMode(value)

Bases: Enum

This enumeration represents the way how recipe variables are written.

Version added:

4.2.0.0

limit_min_max = 0

Limit variable to min/max when value out of range (default)

skip_min_max_exceeded = 1

Do not write value when out of range

class ScriptRecipeManagerObject.RecipeStorageType(value)

Bases: Enum

This enumeration represents the way how recipes are stored.

Version added:

4.2.0.0

textual = 0

Textual (default)

binary = 1

Binary

class ScriptRecipeManagerObject.RecipeStorageSeperator(value)

Bases: Enum

This enumeration represents the possible seperators in the textual recipe storage file.

Version added:

4.2.0.0

assign = 0

Assign (:=)

tab = 1

Tab

semicolon = 2

Semicolon

comma = 3

Comma

space = 4

Space

pipe = 5

Pipe

class ScriptRecipeManagerObject.RecipeStorageColumn(value)

Bases: Enum

This enumeration represents the possible columns that can be stored in the recipe file.

Version added:

4.2.0.0

variable = 0

Variable

currentvalue = 1

Current Value

type = 2

Type

name = 3

Name

comment = 4

Comment

minvalue = 5

Min Value

maxvalue = 6

Max Value

class ScriptRecipeManagerObject.ScriptRecipeManagerMarker

Bases: object

Marker object to check whether a ScriptObject is a recipe manager object.

Version added:

4.2.0.0

property is_recipemanager

Gets a value indicating whether this object is a recipe manager.

Return type:

bool

Returns:

True if it is a recipe manager object; otherwise, False

class ScriptRecipeManagerObject.ScriptRecipeManagerObject

Bases: ScriptRecipeManagerMarker

ScriptObjects which are a recipe manager object are extended with this interface.

Version added:

4.2.0.0

create_recipedefinition(name=None)

Creates a new recipe definition object in the current context (below recipe manager).

Parameters:

name (str) – The name of the new recipe definition object. In case of None, a default name will be generated.

Raises:

ArgumentException – Thrown when an recipe definition with the given name already exists within the current context.

Return type:

ScriptRecipeDefinitionObject

Returns:

The newly created recipe definition object.

property recipe_mgmt_in_plc

Gets or sets the option “Recipe Management in the PLC” (default: TRUE).

Return type:

bool

property save_to_file_automatically

Gets or sets the option “Save recipe changes to recipe files automatically” (default: TRUE).

It is only possible when recipe_mgmt_in_plc is active.

Return type:

bool

property overwrite_recipes_on_download

Gets or sets the option “Overwrite existing recipes on download” (default: TRUE).

It is only possible when recipe_mgmt_in_plc and save_to_file_automatically is active.

Return type:

bool

property load_recipe_mode

Gets or sets the option “Load Recipe”.

It is only possible when recipe_mgmt_in_plc is active.

The following modes are available:

  • Loads the recipe only when all recipe variables are available and in the right order in the recipe file (default) - LoadRecipeMode.load_exactly_only

  • Loads those values from the recipe file where an according variable is in the recipe - LoadRecipeMode.load_by_variablename

Return type:

LoadRecipeMode

property write_recipe_mode

Gets or sets the option “Write Recipe”.

The following modes are available:

  • Limit variable to min/max when value out of range (default) - WriteRecipeMode.limit_min_max

  • Do not write value when out of range - WriteRecipeMode.skip_min_max_exceeded

Return type:

WriteRecipeMode

property save_changed_recipes_only

Gets or sets the option “Check recipe for changes” (default: FALSE).

If the option is TRUE, the recipe is only saved when a variable has changed.

Return type:

bool

property storage_type

Gets or sets the option “Storage type”.

The following types are available:

  • Textual (default) - RecipeStorageType.textual

  • Binary - RecipeStorageType.binary

Return type:

RecipeStorageType

property storage_file_path

Optionally a path where the recipes should be stored can be specified.

Return type:

str

property storage_file_extension

Gets or sets the option “File extension”.

Return type:

str

property storage_separator

A seperator symbol can be specified.

Supported symbols are:

  • ‘:=’(default) - RecipeStorageSeperator.assign

  • Tab - RecipeStorageSeperator.tab

  • Semicolon - RecipeStorageSeperator.semicolon

  • Comma - RecipeStorageSeperator.comma

  • Space - RecipeStorageSeperator.space

  • ‘|’ - RecipeStorageSeperator.pipe

Return type:

RecipeStorageSeperator

property storage_columns

It is possible to configure columns that should be stored in the file. They will be stored in the specified order.

Supported columns are:

  • Variable - RecipeStorageColumn.variable

  • Current Value - RecipeStorageColumn.currentvalue

  • Type - RecipeStorageColumn.type

  • Name - RecipeStorageColumn.name

  • Comment - RecipeStorageColumn.comment

  • Minimal Value - RecipeStorageColumn.minvalue

  • Maximal Value - RecipeStorageColumn.maxvalue

Return type:

RecipeStorageColumn

class ScriptRecipeManagerObject.ScriptRecipeManagerObjectContainer

Bases: object

Application Objects are extended with this interface since CODESYS Recipes V4.2.0.0.

Version added:

V4.2.0.0

get_recipemanager()

Creates a new recipe manager object in the current context or returns the existing recipemanager.(application only).

Raises:

InvalidOperationException – Thrown when not called on an application.

Return type:

ScriptRecipeManagerObject

Returns:

The existing or newly created recipe manager object.

property has_recipemanager

Checks whether there is already a recipe manager in the current location.

Raises:

InvalidOperationException – Thrown when not called on an application.

Return type:

bool