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!
version 2.1 (02.10.1042) issue
Re: version 2.1 (02.10.1042) issue
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.
Therefore I had to use the "AnalogNumeric.Text" to retrieve the correct input value.
-
- Posts: 137
- Joined: Mon Jun 11, 2012 2:10 pm
Re: version 2.1 (02.10.1042) issue
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:
To force the input value to a specific type, you could use something like "Convert.ToDouble(e.Value)".
Example:
Code: Select all
void AnalogNumeric1_InputValueChanged(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
{
Globals.Tags.Tag2.Value = e.Value;
}