Automatically saving last loaded recipe.

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
jydepower
Posts: 26
Joined: Thu Aug 16, 2012 9:33 am

Automatically saving last loaded recipe.

Post by jydepower »

Hallo.

The action save recipe has 2 sub menus. 1. where OP has to choose a recipe. And 2. where i choose the RecipeTitle upfront.

Is it possible by scripting to save to the last loaded recipe. Like in option 2.

So OP only needs to say yes or no to save.

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Automatically saving last loaded recipe.

Post by mark.monroe »

Yes, you can create your own recipe dialog. See this forum post that contains an example.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

jydepower
Posts: 26
Joined: Thu Aug 16, 2012 9:33 am

Re: Automatically saving last loaded recipe.

Post by jydepower »

Thanks for your reply.

I don't think this is exactly what im looking for.

Basically i want to automatically save/overwrite the last loaded recipe with the current loaded values. I want the OP to avoid choosing from a list, to avoid overwriting another one. How do i find the script commands that fires when you normally use the save dialog?

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Automatically saving last loaded recipe.

Post by mark.monroe »

On screen two there is a script associated with the button on the screen. That allows you to dynamically load a recipe. You can use the function Globals.Recipe1.SaveRecipe to save the recipe. Saving a recipe will save the values that are loaded in the tags associated to the recipe.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

jydepower
Posts: 26
Joined: Thu Aug 16, 2012 9:33 am

Re: Automatically saving last loaded recipe.

Post by jydepower »

Problem is when i use the Globals.Recipe.SaveRecipe function it opens the save recipe popup window. And there i have to choose a recipe again. I want to save it directly like you do with the load function.

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Automatically saving last loaded recipe.

Post by mark.monroe »

The Globals.Recipe1.SaveRecipe function has an overload where you can place the name of the recipe you want to save. So you can do this: Globals.Recipe1.SaveRecipe("MyRecipeName"). Since all recipes have to have names, if you do not pass a recipe name to the function it will ask you for one.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Post Reply