Load recipe

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
smolenak
Posts: 22
Joined: Tue Nov 20, 2012 3:06 am

Load recipe

Post by smolenak »

Hello,

I'm trying to get recipes loaded with

Globals.Tags.Recipes.LoadRecipe(stringTag);

I have list box where all recipenames are, and by choosing recipe it is assigned to stringTag. But how can I use stringTag to load recipe? It does not accept to use the string type tag..?

I hope fast reply - Thanks!

User avatar
Edmund
Posts: 92
Joined: Thu Nov 29, 2012 2:27 pm

Re: Load recipe

Post by Edmund »

Hi smolenak,

It´s easy, just call the "recipe-handler" you want to load the recipe in and call the function LoadRecipe.

In iX there is a demo project called Sample_Recipe, add a button to the Recipe screen (Button1) and add this into the click event.

Code: Select all

void Button1_Click(System.Object sender, System.EventArgs e)
{
	Globals.Recipe1.LoadRecipe("Full Speed");
}
And you will see that it will load the recipe with the name "Full Speed".

If you are usring a iX-tag instead of the hardcoded example above, make sure it´s being cast as a String (if it´s set to default in the taglist), Globals.Tags.Tag_Recipe.Value.ToString()

Best Regards

Edmund
Edmund Andersson

AITECH AB

Part of Beijer Integrator Group

Post Reply