version 2.1 (02.10.1042) issue

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
ladin79
Posts: 19
Joined: Tue Nov 13, 2012 12:25 pm

version 2.1 (02.10.1042) issue

Post by ladin79 »

Hello,
I recently converted my project iX version 2.0 SP1 to version 2.1 (02.10.1042) but unfortunately I noticed a problem with the event "_InputValueChanged" of fields "AnalogNumeric", when I enter a number in a field "AnalogNumeric" to which I assigned a variable eg. Tag1, if I use the variable Tag1 in the event "_InputValueChanged" of the same field with the value of the Tag1, the tag value maintain the old value (the one before the entry of the new value) , I try to explain better with an example:

if I assigne in the AnalogNumeric1 the Tag1 and then use this script:

void AnalogNumeric1_InputValueChanged (System.Object sender, and Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs )
{
Globals.Tags.Tag2.Value = Globals.Tags.Tag1.Value ;
}

when at runtime I change the value field AnalogNumeric1 for example by entering the number 5, in Tag2 I found 0 , then if I enter in the field AnalogNumeric1 the number 8, in Tag2 I will find the value 5 and so I always find the previous one.

In version 2.0 SP1, the value was updated immediately.

The problem is that I have used this event many times in my project , can you help me?

Thank you very much!

bjornidar
Posts: 49
Joined: Thu Nov 17, 2011 2:10 am
Location: Norway
Contact:

Re: version 2.1 (02.10.1042) issue

Post by bjornidar »

I also noticed this, the value isn't set until next time it has changed.
Therefore I had to use the "AnalogNumeric.Text" to retrieve the correct input value.

AMitchneck
Posts: 137
Joined: Mon Jun 11, 2012 2:10 pm

Re: version 2.1 (02.10.1042) issue

Post by AMitchneck »

You could use "e.Value" from the event args. This variable is populated with the user's input value before the InputValueChanged event is raised.

Example:

Code: Select all

void AnalogNumeric1_InputValueChanged(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
{
	Globals.Tags.Tag2.Value = e.Value;
}
To force the input value to a specific type, you could use something like "Convert.ToDouble(e.Value)".

Post Reply