updateRecipeType

[ Function ]

public static updateRecipeType (
    recipeTypeName: string,
    recipeType: TcHmi.Server.RecipeManagement.RecipeType,
    path: string | null,
    callback: null | ((this: void, data: TcHmi.IResultObject) => void) = null
): TcHmi.IErrorDetails;

Changes a recipe type.

Parameter

Name

Type

Description

recipeTypeName

string

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

recipeType

TcHmi.Server.RecipeManagement.RecipeType

Recipe type definition

path

string

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.

updateRecipeType 1:

Available from version 1.12

Sample - JavaScript

let recipeType = {
    'recipeTypeNames': ['recipeType1', 'recipeType10'],
    'members':
    {
        'INGREDIENT': {
            symbol: 'PLC1.MAIN.test11',
            defaultValue: true
        },
        'test10': {
            symbol: 'PLC1.MAIN.test10',
            defaultValue: true
        }
    },
    'options': {
        'enabled': 'None',
        'comment': ''
    }
};
TcHmi.Server.RecipeManagement.updateRecipeType(
    'recipeType10',
    recipeType,
    'testRecipeCategory',
    function (data) {
        if (data.error === TcHmi.Errors.NONE) {
            // Success
        } else {
            // Error
        }
    }
);

Sample - TypeScript

let recipeType: TcHmi.Server.RecipeManagement.RecipeType = {
    'recipeTypeNames': ['recipeType1', 'recipeType10'],
    'members':
    {
        'INGREDIENT': {
            symbol: 'PLC1.MAIN.test11',
            defaultValue: true
        },
        'test10': {
            symbol: 'PLC1.MAIN.test10',
            defaultValue: true
        }
    },
    'options': {
        'enabled': 'None',
        'comment': ''
    }
};
TcHmi.Server.RecipeManagement.updateRecipeType(
    'recipeType10',
    recipeType,
    'testRecipeCategory',
    function (data) {
        if (data.error === TcHmi.Errors.NONE) {
            // Success
        } else {
            // Error
        }
    }
);