Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Recipe Manager - RecipeManCommands, load & write wrong values, Bug?

ewi04
2023-11-09
2024-03-04
  • ewi04 - 2023-11-09

    Hallo, I have a strange problem with the recipe manager.

    ISSUE: When using RecipeManCommands not all values are loaded correctly.

    Saving a recipe with CreateRecipe(), ReadAndSaveRecipe() or ReadAndSaveRecipeAs() works without any problems.

    BUT: LoadRecipe(), WriteRecipe() or LoadFromAndWriteRecipe() do not load the data correctly.

    It is Interesting that we have a different error pattern with LoadRecipe() than with WriteRecipe() or LoadFromAndWriteRecipe().

    LoadRecipe() does not load all data and WriteRecipe() or LoadFromAndWriteRecipe() overwrites some data or assigns it incorrectly.

    And it is also strange that LoadRecipe() writes the values to the PLC. Normally it doesn’t do it.

    It makes no difference whether the memory type is textual or binary.

    I have an object consisting of STRUCTs which is inserted in the recipe definition.

    Environment: Codesys V3.5 SP19 Patch 4 (64Bit), Recipe Management 4.2.0.0

    *Add a project (reduced to the problem)

     

    Last edit: ewi04 2023-11-15
    • ewi04 - 2023-11-09

      The individual structures were declared in a separate global variable list on a trial basis. But even this did not change the behavior.

      A total of 1667 variables are processed in a recipe. A reduction (e.g. saving only the first three drive parameter sets) also brought no change.

       

      Last edit: ewi04 2023-11-15
  • ewi04 - 2023-11-15

    It seems that there is a limitation with the STRUCTs. Does anybody know, what’s okay to save (add to the recipe) and what’s not okay? Or is there another problem with my project?

    If I have only an array in the recipe definition everything works perfectly (see project).

     
  • ewi04 - 2023-11-16

    I'm getting closer to the error. The combination of STRUCT and ARRAY probably causes the strange behavior. As soon as the ARRAY is followed by a variable, the problem arises. Examples:

    X: ARRAY[1..2] OF INT; // okay
    
    Y: ARRAY[1..2] OF STRUCT; // problem
    
    Z: STRUCT;
    
       Z.ArrayOfInt[1]; // okay
       Z.ArrayOfStruct[1].Variable // problem
    
    // *update - array of array also causes the error
    A: ARRAY[1..2] OF ARRAY[1..4] OF BOOL; // problem
    

    I can't be the only one who has this problem. Or? Maybe there is a solution. Anyone? Or is it a bug after all?

     

    Last edit: ewi04 2023-11-17
  • mputaggio - 2023-12-15

    Hello,

    We encountered the same issues on both recipe library versions 4.2.0.0 and the newest 4.3.0.0.

    The Arrays of structs get saved correctly but loading them restores only some indexes, while others get lost or completely wrong.

    We have been using the same recipes for the last two years on recipe manager vers. 3.5.17 withoud issues.

    There also seems to be a different behaviour in vers. 4.3.0.0 but it's still incorrectly loading the recipes.

    Did you find any workaround or solution?

    Codesys version used: 3.5.19.50

     
    • ewi04 - 2024-01-04

      Hello,

      according to Codesys, the problem should be solved with version 4.3.0.0.

      After the update to version 4.3.0.0 I had the problem that the recipes weren’t saved correctly, but loading was okay. Return to the version 4.2.0.0 didn’t change the behavior. Strange…

      So I uninstalled the update, cleaned the project and built it new. The known behavior of version 4.2.0.0 was back. Update to version 4.3.0.0, clean and build it new, it works. Even with version 4.2.0.0. Strange, but okay.

      Notice: ManCommands.LoadRecipe() no longer writes into the PLC. Just as it should be.

      As of now, I can use the new version.

       

      Last edit: ewi04 2024-01-05
  • SiegeLion - 2023-12-16

    I have also been troubled by this issue for a long time, to the extent that I have to implement a recipe management library myself.
    Codesys version used: 3.5.19.40

     
    • ewi04 - 2024-01-04

      Nice to hear that I'm not the only one. I share your suffering. I was on the verge of doing the same.

       
  • dominggus - 2024-02-26

    I still have the same problem even when updating to CODESYS Recipes 4.3.0.0. My scenario:

    I'm trying to save/load an array of structs using the Visu:
    - Execute Command > "SaveRecipeAs" works properly
    - Execute Command > "LoadWriteRecipe" works not entirely: the structs of array[6] and array[7] should have been empty but were duplicates of array[4] and array[5]...

    the struct contains 26 variables and the array's length is 30.. Maybe there is a upper limit on recipe variable count?

     

    Last edit: dominggus 2024-03-02
  • dominggus - 2024-03-02

    I've workaround it by not using an array but 30 instances of the struct and putting these in the recipe, and then using converter functions to save and load

     
  • ewi04 - 2024-03-04

    It's good that you've found a workaround. But it's bad that you need one.

    The array length auf my struct is 16. My struct also contains other arrays of structs. It contains a total of 1716 variables. I have tested saving and loading extensively under version 4.3.0.0. It looks good. I couldn’t find any problems. Maybe it helps to reinstall the update (see previous post). Otherwise you could try my test project (first post). This should work with version 4.3.0.0.

     

Log in to post a comment.