TeachAsNewRecipe

function TeachAsNewRecipe(ctx: Required<TcHmi.Context>, recipeReference: string, newRecipeName: string, newRecipePath: string)

The TeachAsNew function reads the current values of the symbols of a defined recipe from the target and stores them in a new recipe.

Parameter

Name

Type

Description

ctx

Available from version 1.10

Required<TcHmi.Context>

Context object

Does not need to be specified by the user when used in a trigger or function expression. In this case the transfer and the evaluation is done by the corresponding parser.

Is used by the caller to indicate success or failure to the framework during execution.

If the function is used directly in JavaScript/TypeScript, the context object must be passed in the call and evaluated if necessary.

recipeReference

string

The reference of the recipe (path plus name) whose current symbol values are to be read from the target.

Samples:

‚MyRecipe1‘

‚MyFolder::MyRecipe2‘

newRecipeName

string

The name of the new recipe that is to be created and in which the values are to be stored.

If required, this name can already contain the folder structure in which the recipe is to be stored. Otherwise the folder structure can be specified under newRecipePath.

newRecipePath

string

The path under which the new recipe is to be stored.

If this parameter is empty, the recipe is created at the highest folder level.

Sample:

‚MyFolder‘

‚MyFolder1::MyFolder2‘

Return value

Type

Description

void

No return value.

NuGet package: Beckhoff.TwinCAT.HMI.Functions

TeachAsNewRecipe 1:

NuGet packages are available from version 1.12.

TeachAsNewRecipe 2:

Available from version 1.10.1171.142