Using Recipes in Visualization Elements

You can manage and use the recipes created in CODESYS by means of a visualization. For this purpose, the input configuration of a visualization element provides the following commands:

  • Read recipe
  • Write recipe
  • Load recipe from file
  • Save recipe to file
  • Create recipe
  • Delete recipe

See also

Example: Loading recipes by means of visualization elements

Requirement: The Visualization object is added to the project.

  1. Create a recipe according to the instructions in the section “Changing Values with Recipes - Creating Recipes”.

    Assign the following names:

    • Recipe definition: “Recipes”
    • Recipes: “Recipe1” and “Recipe2”
    • Variables: iValue1 and iValue2

    Type in different variable values of both recipes.

  2. Open the Visualization object in the editor.

  3. Drag a Button element to the visualization. Label it “Load Recipe 1”. You can specify the text by double-clicking the element or in the Texts ‣ Text property.

  4. Click the value field of the Input configuration: OnMouseDown property.

    The Input Configuration dialog box opens.

  5. Select Execute command in the left of the left side and click the button 183888e6fd5e2103c0a8640e01a09587_62e36f8073f8950ac0a8640e00982903

    The configuration of the Internal command opens on the right side of the dialog.

  6. Select the Write Recipe command from the drop-down list.

  7. Click the 183888e6fd5e2103c0a8640e01a09587_10985cd04c7f98c3c0a8640e01d12841 button.

    The WriteRecipe command is added to the list.

  8. Specify the first parameter as Recipes and the second parameter as Recipe1.

  9. Click OK to close the dialog box.

  10. Drag a second button to the visualization, name it “Load Recipe 2”, and repeat steps 4 to 8. For step 7, specify Recipe2 as the second parameter.

  11. Load the program to the controller and start it Click the Load Recipe 1 and Load Recipe 2, and monitor the variables iValue1 and iValue2.

The other recipe commands are assigned to visualization elements as described in this example. Refer to the help page of the input configuration for a description of the internal commands.