createRecipeTypeEx
[ Function ]
public static createRecipeTypeEx (
recipeTypeName: string,
recipeType: TcHmi.Server.RecipeManagement.RecipeType,
path: string | null,
options?: TcHmi.Server.RecipeManagement.IRecipeOptions | null,
requestOptions: TcHmi.Server.IRequestOptions | null = null,
callback: null | ((this: void, data: TcHmi.IResultObject) => void) = null
): TcHmi.IErrorDetails;
Creates a new recipe type.
Parameter
Name | Type | Description |
---|---|---|
recipeTypeName | Name of the recipe type. The name may include the full path. In this case, '::' must be used as the separator for folders. | |
recipeType | Recipe type definition | |
path | Path of the destination folder. If this is not specified, the recipe type is created in the main folder. | |
options | Recipe management options | |
requestOptions | Server request options | |
callback [ optional ] | (data: TcHmi.IResultObject) => void, null | Asynchronous callback function that is triggered once the action is completed. |
Return value
Type | Description |
---|---|
Returns confirmation as to whether the operation was successfully sent. |
Available from version 1.10.1171.142 |
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.createRecipeTypeEx(
'recipeType10',
recipeType,
'testRecipeCategory',
null,
{ timeout: 2000 },
function (data) {
if (data.error === TcHmi.Errors.NONE) {
// Success
} else {
// Error
}
}
);
// or the same:
TcHmi.Server.RecipeManagement.createRecipeTypeEx(
'testRecipeCategory::recipeType10',
recipeType,
null, // or ''
null,
{ timeout: 2000 },
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.createRecipeTypeEx(
'recipeType10',
recipeType,
'testRecipeCategory',
null,
{ timeout: 2000 },
function (data) {
if (data.error === TcHmi.Errors.NONE) {
// Success
} else {
// Error
}
}
);