Certain values of real type variables show extra characters in the recipe. The extra characters are also present in the recipe text file. As far as I can see, despite the strange extra characters the values save and restore properly, but it is causing some concern.
Has anyone had a similar problem? Is there a way to solve this?
For example:
The value 0.9 saves as 0.9F16#E666666H-6
The value 0.99 does something similar.
the value 1.9 does something similar
the value 2.9 saves and displays properly.
There are some other values that do this too, though most store properly.
Using RecipeManCommands function block to load and save recipes.
The arrays which hold the recipe values are defined like this:
Certain values of real type variables show extra characters in the recipe. The extra characters are also present in the recipe text file. As far as I can see, despite the strange extra characters the values save and restore properly, but it is causing some concern.
Has anyone had a similar problem? Is there a way to solve this?
For example:
The value 0.9 saves as 0.9F16#E666666H-6
The value 0.99 does something similar.
the value 1.9 does something similar
the value 2.9 saves and displays properly.
There are some other values that do this too, though most store properly.
Using RecipeManCommands function block to load and save recipes.
The arrays which hold the recipe values are defined like this:
Code to save the current PLC values to the recipe:
Code that loads the recipe values from the recipe storage to the display arrays
Project Info:
Codesys Version 3.5.16.40 64bit
RecipeManagement 3.5.16.40
Recipe Storage Textual
Using Comma separator
Recipe Management in the PLC
Hey,
The values appended are the exact binary value.
With Recipes 4.1.0.0 this value can be skipped from being created with the compiler define RECIPE_GENERATE_SIMPLE_STRINGREAL.
Best regards,
Marcel
Marcel,
Thank you, i see how the value is the exact binary value now.
I am not familiar with Recipes 4.1.0.0, is this a library?
Is there a way i can implement this option in my project?
Hey,
4.1.0.0 is the lib version
You can always simply split the string apart at the # and use the first index.
Best regards,
Marcel