Requirement: A Recipe Manager is available in the application. In a recipe definition,
there is a “myRec” recipe with variable values. A myRec.txt
recipe file is located on the file system and contains the entries for this recipe.
Example of the recipe file:
PLC_PRG.bVar:=0 PLC_PRG.iVar:=2 PLC_PRG.dwVar:=35232 PLC_PRG.stVar:='first' PLC_PRG.wstVar:='123443245'
-
Double-click the “Recipe Definition” object in the device tree to open the tabular editor for the definition of the individual recipes.
You see the
myRec
column with the current values for this recipe. -
Edit the
myRec.txt
file in an external text editor and replace the variable values with other values that you want to load into the recipe definition in CODESYS. Save the file. -
In the recipe definition, click the “myRec” column and in the context menu click “Load Recipe”.
A dialog prompt notifies you about the possibly needing to perform an online change when logging in again. An online change is necessary when you change the current values of the recipe variables by loading the recipe.
-
Click “Yes” to close the dialog and continue. Select the
myRec.txt
file from the file explorer for loading.The recipe values in the recipe definition are updated according to the values read in the file.
If you want to overwrite only individual recipe variables with new values, then remove the values for the other variables before loading to the recipe file. Entries without value definitions are not read, and therefore updating leaves these variables unchanged on the controller and in the project.
For values of the data type REAL
/LREAL
, the hexadecimal value is also written to the recipe file in some cases. This is
necessary so that the exactly identical value is restored when converting back. In
this case, you change the decimal value and delete the hexadecimal value.