teachAsNewRecipe

[ Function ]

public static teachAsNewRecipe (
    recipeName: string,
    path: string | null,
    newRecipeName: string,
    newRecipePath: string | null,
    callback: null | ((this: void, data: TcHmi.IResultObject) => void) = null
): TcHmi.IErrorDetails;

Reads the current values from the target system (referenced by a recipe) and writes them into a new recipe.

Parameter

Name

Type

Description

recipeName

string

Name of the recipe. The name may include the full path. In this case, '::' must be used as the separator for folders.

path

string, null

Path of the destination folder. If this is not specified, the recipe type is created in the main folder.

newRecipeName

string

Name of the new recipe. The name may include the full path. In this case, '::' must be used as the separator for folders.

newPath

string, null

Path of the destination folder. If this is not specified, the recipe type is created in the main folder.

callback [ optional ]

(data: TcHmi.IResultObject) => void, null

Asynchronous callback function that is triggered once the action is completed.

Return value

Type

Description

TcHmi.IErrorDetails

Returns confirmation as to whether the operation was successfully sent.

teachAsNewRecipe 1:

Available from version 1.10.1171.142

Sample - JavaScript

TcHmi.Server.RecipeManagement.teachAsNewRecipe (
    'recipe10',
    'testRecipeCategory',
    'recipe11',
    'newRecipesCategory',
    function(data) {
        if (data.error === TcHmi.Errors.NONE) {
            // Success
        } else {
            // Error
        }
    }
);