RecipeManCommands

Overview

When calling a recipe command, internal data access is performed. Depending on the device type, this takes a few milliseconds. Verify that these calls are not performed by the MAST task or by a task with a configured watchdog or a real-time task. This may lead to an application error and the controller will enter the HALT state.

Consider that the option Save recipe changes to recipe files automatically also performs a file access with each modification of the recipe. Deactivate this option if the storage of the recipe is triggered by the application.

Return Values

For possible return values for recipe commands, refer to the Recipe Management Library Documentation.

CreateRecipe

This method creates a new recipe in the specified recipe definition and afterwards reads the controller values into the new recipe. At the end, the new recipe is stored in the default file.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName:

STRING

Name of the recipe.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_ALREADY_EXIST, ERR_FAILED, ERR_OK

CreateRecipeNoSave

This method creates a new recipe in the specified recipe definition and afterwards reads the controller values into the new recipe.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName:

STRING

Name of the recipe.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_FAILED, ERR_OK

DeleteRecipe

This method deletes a recipe from a recipe definition.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName:

STRING

Name of the recipe.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_FAILED, ERR_OK

DeleteRecipeFile

This method deletes the default recipe file from a recipe.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName:

STRING

Name of the recipe.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_RECIPE_FILE_NOT_FOUND, ERR_OK

LoadAndWriteRecipe

This method loads a recipe from the default recipe file and afterwards writes the recipe into the controller variables.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName:

STRING

Name of the recipe.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_RECIPE_FILE_NOT_FOUND, ERR_RECIPE_MISMATCH, ERR_FAILED, ERR_OK

LoadFromAndWriteRecipe

This method loads a recipe from the specified recipe file and afterwards writes the recipe into the controller variables.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName:

STRING

Name of the recipe.

FileName:

STRING [255]

Name of the file.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_RECIPE_FILE_NOT_FOUND, ERR_RECIPE_MISMATCH, ERR_FAILED, ERR_OK

LoadRecipe

This method loads a recipe from the default recipe file. The default recipe file name is <recipe>.<recipe definition>.<recipeextension>.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName:

STRING

Name of the recipe.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_RECIPE_FILE_NOT_FOUND, ERR_RECIPE_MISMATCH, ERR_FAILED, ERR_OK

ReadAndSaveAs

This method reads the controller values from the variables of the recipe definitions and afterwards stores the data set to a file recipe without modifying the default recipe file <recipe.recipe definition.extension>.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition. The variables defined in the recipe definition are read.

FileName:

STRING[255]

Name of the file in which the read data set is saved as a recipe.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_SAVE_ERR, ERR_OK

ReadAndSaveRecipe

This method reads the controller values into the recipe and afterwards stores the recipe into the default recipe file.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName:

STRING

Name of the recipe.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_RECIPE_SAVE_ERR, ERR_FAILED, ERR_OK

ReadAndSaveRecipeAs

This method reads the controller values into the recipe and afterwards stores the recipe into the specified recipe file. The content of an existing file would be overridden.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName:

STRING

Name of the recipe.

FileName:

STRING [255]

Name of the file.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_RECIPE_SAVE_ERR, ERR_FAILED, ERR_OK

SaveRecipe

This method stores the recipe into the default recipe file. The content of an existing file would be overridden. The default recipe file name is <recipe>.<recipedefinition>.<recipeextension>.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName:

STRING

Name of the recipe.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_RECIPE_SAVE_ERR, ERR_FAILED, ERR_OK

ReadRecipe

This method reads the controller values into the recipe.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName:

STRING

Name of the recipe.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_FAILED, ERR_OK

WriteRecipe

This method writes the recipe into the controller variables.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName:

STRING

Name of the recipe.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_FAILED, ERR_OK

ReloadRecipes

This method reloads the list of recipes from the file system.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_FAILED, ERR_OK

GetRecipeCount

This method returns the number of recipes from the corresponding recipe definition.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

Return values: -1 : if the recipe definition is not found.

GetRecipeNames

This method returns the recipe names from the corresponding recipe definition.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

pStrings :

POINTER TO ARRAY [] OF STRING

The strings where the recipe values should be stored.

iSize :

INT

The size of an array of strings.

iStartIndex :

INT

The start index; can be used for a scrolling function.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_FAILED, ERR_OK

Example:

There are 50 recipes. To create a table which shows 10 recipe names at a time, define an array of strings:

strArr: ARRAY[0..9] OF STRING;

Corresponding to the iStartIndex, the recipe names can be read from a specific area.

iStartIndex := 0;

The names 0...9 are returned.

iStartIndex := 20;

The names 20...29 are returned. In this example:

iSize := 10;

GetRecipeValues

This method returns the recipe variable values from the corresponding recipe.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName :

STRING

Name of the recipe.

pStrings :

POINTER TO ARRAY [] OF STRING

The strings where the recipe values are to be stored.

iSize :

INT

The size of an array of strings.

iStartIndex :

INT

The start index; can be used for a scrolling function.

iStringLength :

INT

The length of the string in the array.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_FAILED, ERR_OK

Example:

There are 50 recipes. To create a table which shows 10 recipe names at a time, define an array of strings:

strArr: ARRAY[0..9] OF STRING;

Corresponding to the iStartIndex, the recipe names can be read from a specific area.

iStartIndex := 0;

The values 0...9 are returned.

iStartIndex := 20;

The values 20...29 are returned. In this example:

iStringLength := 80;
iSize := 10;

GetRecipeVariableNames

This method returns the variable name of the corresponding recipe.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName :

STRING

Name of the recipe.

pStrings :

POINTER TO ARRAY [] OF STRING

The strings where the recipe values should be stored.

iSize :

INT

The size of an array of strings.

iStartIndex :

INT

The start index; can be used for a scrolling function.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_FAILED, ERR_OK

Example:

There are 50 recipes. To create a table which shows 10 recipe names at a time, define an array of strings:

strArr: ARRAY[0..9] OF STRING;

Corresponding to the iStartIndex, the recipe names can be read from a specific area.

iStartIndex := 0;

The names 0...9 are returned.

iStartIndex := 20;

The names 20...29 are returned. In this example:

iSize := 10;

SetRecipeValues

This method sets the recipe values into the corresponding recipe.

Parameter

Data type

Description

RecipeDefinitionName:

STRING

Name of the recipe definition.

RecipeName :

STRING

Name of the recipe.

pStrings :

POINTER TO ARRAY [] OF STRING

The strings where the recipe values should be stored.

iSize :

INT

The size of an array of strings.

iStartIndex :

INT

The start index; can be used for a scrolling function.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_RECIPE_DEFINITION_NOT_FOUND, ERR_RECIPE_NOT_FOUND, ERR_FAILED, ERR_OK

Example:

There are 50 recipes. To create a table which shows 10 recipe names at a time, define an array of strings:

strArr: ARRAY[0..9] OF STRING;

Corresponding to the iStartIndex, the recipe names can be read from a specific area.

iStartIndex := 0;

The values 0...9 are set.

iStartIndex := 20;

The values 20...29 are set. In this example:

iStringLength := 80;
iSize := 10;

GetLastError

This method of data type DWORD returns the last detected error of the previous operations.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_OK

ResetLastError

This method of data type DWORD resets the last detected error.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_OK

SetStoragePath

This method allows you to set the storage path for the recipe file. It overwrites the File Path configured in the Recipe Manager dialog box.

Parameter

Data type

Description

stPath

STRING

The method returns TRUE if the path is set, as for example: D:/recipefiles/.

The method returns FALSE:

  • If there is no Recipe Manager available in the application.

  • If there is no recipe definition available below the Recipe Manager node.

Return values: ERR_NO_RECIPE_MANAGER_SET, ERR_OK