KB-71403: Reloading a recipe when restarting an application.

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)

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.

Attachments:

Load&ChooseRecipe_enu

Este artigo foi útil? Was this post helpful?
Yes1
No0

Leave a Reply

Your email address will not be published.Required fields are marked *