Object Recipe Manager

Symbol: Object Recipe Manager 1:

The recipe manager offers functions for the administration of user-defined variable lists: so-called recipe definitions. The recipe definitions can be stored in "Recipe files".

If you add a recipe manager to the PLC project, the library RecipeManagement is automatically added in the library manager.

Create object Recipe Manager

1. Select the PLC project in the Solution Explorer.
2. Select the command Add > Recipe Manager... in the context menu.
The dialog Add Recipe Manager opens.
3. Enter a name.
4. Click on Open.
The recipe manager is added to the PLC project tree and opened in the editor. Subsequently, you can add the object Recipe Definition to the object Recipe Manager.

Structure of the recipe manager

The editor of the recipe manager is comprised of the two tabs Storage and General, in which the settings for the recipe manager are determined.

Tab Storage

Object Recipe Manager 2:

Storage Type

textual: TwinCAT saves the recipe in a readable format with the configured columns and separators.

binary: TwinCAT saves the recipe in a non-readable binary format. This format requires less storage space.

You can only read recipes saved in binary format back in if you have not changed the variable lists.

File path

Relative path on the runtime system.

This path is created on the target system in the directory of the runtime files. TwinCAT creates a file for each recipe in this directory on downloading to the controller. The prerequisite is that the option Recipe Management in the PLC is activated.

The files are loaded into the recipe manager each time the PLC project is restarted.

File extension

File extension for the recipe file.

This results in the standard name for recipe files in the form <Recipe>.<Recipe definition>.<File extension>.

Separator

Separators between the individual values in the stored file.

Available Columns

Selected Columns

Definition stating what information is saved in the recipe file and in what order.

Save as default

TwinCAT uses the settings in the dialog immediately as default settings.

Tab General

Object Recipe Manager 3:

Recipe Management in the PLC

Object Recipe Manager 4:: Must be activated if recipes are loaded at runtime via visualization elements or via the user program. The option can be deactivated if recipes are transferred to the controller exclusively via the TwinCAT programming interface.

Save Recipe

Save recipe changes to recipe files automatically

Object Recipe Manager 5:: Recommended option, because it causes the "usual" behavior of a recipe management. At runtime the recipe manager saves the recipes automatically to a file in the case of a change; i.e. the memory files are updated automatically on each change of a recipe at runtime.

The option is only effective if the option Recipe management in the PLC is activated.

Load Recipe

Load only by exact match of variable list

The recipe is only loaded if the file contains all variables from the variable list of the recipe definition of the PLC project and these are sorted in the same order. Additional entries at the end are ignored. If the necessary match is not present, the error state ERR_RECIPE_MISMATCH is set (RecipeManCommands.GetLastError).

Load matching variables by variablename

The recipe values are only loaded for those variables that have the same name in the recipe definition of the PLC project as in the recipe file. If the variable lists differ in composition and sorting, no error state is set.

This allows recipe files to be loaded even if variables have been deleted from the file or the recipe definition.

Overwrite existing recipes during download

Object Recipe Manager 6:: If recipe files with the same name exist on the controller, they are overwritten with the configured values from the project when the PLC project is started. If the values are to be loaded from the existing recipe files instead, this option must be deactivated.

Prerequisite: Storage type is textual and the option Save recipe changes to recipe files automatically is activated.

Write Recipe

Limit variable to min/max if recipe value out of range

If the recipe contains a value that is outside the value range entered in the definition, the defined minimum or maximum value is written to the PLC variable instead of this value.

Do not write variable if recipe value outside min/max range

If the recipe contains a value that is outside the value range entered in the definition, no value is written to the PLC variable. It retains its current value.

Read Recipe

Load only by exact match of variable list

Object Recipe Manager 7:: With each method call, the current PLC variable values are first read into the recipe. Then it is checked whether the values have changed. Only if the values have changed, the recipe is saved, i.e. the recipe file is overwritten with the current recipes.

The option can be used to update the recipe file located in the local file system only if recipe values have changed on the PLC. However, this affects performance because additional code is generated for the check.

Object Recipe Manager 8:: With each method call, the current PLC variable values are first read into the recipe. Then the recipe is written to the recipe file in the local file system.

Since each call writes to the file system, the controller can be loaded.

Recipes in online mode, if the option Save recipe changes to recipe files automatically is activated:

Actions

Recipes defined in the project

Recipes defined at runtime

Online reset warm

Online reset cold

Download

The recipes of all recipe definitions are assigned the values from the current project.

Dynamically generated recipes remain unchanged.

Online reset origin

The application is removed from the PLC. If this is followed by a new download, the recipes will be restored as in the case of an online reset warm.

Shutdown and restart of the PLC

After the restart the recipes are reloaded from the automatically created files. The same state as before shutting down is thus restored.

Online Change

The recipe values remain unchanged. During runtime a recipe can only be changed using the commands from the function block RecipeManCommands.

Stop/start

The recipes remain unchanged in the case of a stop/start of the PLC.

Recipes in online mode, if the option Save recipe changes to recipe files automatically is NOT activated:

Actions

Recipes defined in the project

Recipes defined at runtime

Online reset warm

Online reset cold

Download

The recipes of all recipe definitions are assigned the values from the current project. These are only set in the memory, however. The Save recipe command must be used explicitly to store the recipes in a file.

Dynamically generated recipes will be lost.

Online reset origin

The application is removed from the PLC. The recipes will be restored if this is followed by a new download.

Dynamically generated recipes will be lost.

Shutdown and restart of the PLC

After the restart the recipes are reloaded from the automatically created files. The same state as before shutting down is thus restored.

Online Change

The recipe values remain unchanged. During runtime a recipe can only be changed using the commands from the function block RecipeManCommands.

Stop/start

The recipes remain unchanged in the case of a stop/start of the PLC.