Recipe help (again)

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
jmsmoreira
Posts: 28
Joined: Mon Apr 23, 2012 7:03 am

Recipe help (again)

Post by jmsmoreira »

Hi,

I'm using a T10A, with recipes.
I'm using the systemtaglatestloadedrecipename, to display it on an AnalogNumeric of the string type.

What I would like to do is to compare that tag with an empty string to see if there is any recipe loaded or not, but I cannot convert it to string.

is there a way to do it, or any other way to know if there is any recipe loaded or not?

Thanks

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

Re: Recipe help (again)

Post by mark.monroe »

You should be able to write a script code that does what you want. The below lines will check to see if there is a recipe loaded.

AnalogNumeric2 will display either 0 or 1 depending on whether or not a recipe is loaded. You then just need to decide how you want to trigger the code. You could do it when the screen is initially opened or via a button click.

Code: Select all

			if(Globals.Tags.SystemTagLatestLoadedRecipeName.Value == "")
			{
				AnalogNumeric2.Value=0;
			}else
			{
				AnalogNumeric2.Value=1;
			}
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

jmsmoreira
Posts: 28
Joined: Mon Apr 23, 2012 7:03 am

Re: Recipe help (again)

Post by jmsmoreira »

Thanks Mark, I was doing something similar, but I was not using the .value after the system tag.

Post Reply