Question:
When restarting the application, how can load the same recipe being executed before it has stopped?
Solution:
When loading a recipe, you must save its index at a RAM tag’s initialvalue property. When restarting the application (with OnStartRunning event), load the recipe with the RAM tag’s index.
Script for loading the recipe and saving the RAM tag’s initialvalue:
tagIndexRecipe = Recipe1.ChooseRecipe(“Recipes”,-1)
Recipe1.LoadRecipe(tagIndexRecipe)
tagindexRecipe.initialValue = Str(tagIndexRecipe)
Recipe1.LoadRecipe(tagIndexRecipe)
tagindexRecipe.initialValue = Str(tagIndexRecipe)
Script for loading the recipe at startup:
Recipe1.LoadRecipe(tagIndexRecipe)
The attached demo application illustrates this script, and was developed with version 2.29 build 151.