Join us today!

Notifications
Clear all

RecipeManCommands - SetRecipeValues Problem

1 Posts
1 Users
0 Reactions
25 Views
Posts: 1
Topic starter
(@eengineer1689)
New Member
Joined: 2 weeks ago

I am having trouble with the SetRecipeValues method of the RecipeManCommands function block. I create a recipe file using the CreateRecipe method, then I attempt to set the values of this recipe using the SetRecipeValues method. The execution looks like this:

VAR
    RecipeCommands: RecipeManCommands;
    values: ARRAY[0..2] OF STRING[30];
END_VAR

RecipeCommands.CreateRecipe(RecipeDefinitionName := 'DefinitionName',
    RecipeName := 'RecipeName'
);

values[0] := 'val1'
values[1] := INT_TO_STRING(1);
values[2] := 'val2'

RecipeCommands.SetRecipeValues(RecipeDefinitionName := 'DefinitionName',
    RecipeName := 'RecipeName',
    pStrings := ADR(values),
    iSize := 3,
    iStartIndex := 0
);

 

However, when I open the file and look at the values, nothing has changed. The really weird thing is that the method return value is 0 (ERR_OK). If anyone has any ideas why you could get the ERR_OK value after the SetRecipeValues method fails to set the recipe values, I would love your insight.

Reply
Share: