07-12-2013 09:21 AM
Hi
I have to use an event structure for my program.
The order to execute my program:
1. Set increment;
2. Set station number by left or right arrow;
3. Run the program.
The problem with the program:
After the increment is set from large number (e.g. 10) to small number (e.g. 5), the left or right arrow does not use the new increment value at the first time the left or right arrow is pressed. However, if the increment is set from small number (e.g. 5) to large number (e.g. 10), the left or right arrow use the new increment value at the first time the left or right arrow is pressed. Why? Any suggestions would be appreciated.
Thank you,
Steve
07-12-2013 09:27 AM
Please post the code in 2011 version
07-12-2013 09:31 AM
Its working very fine for me.
07-12-2013 09:33 AM
Steve,
the reason for the behavior is that you do not make sure that the value change event for setting the new increment has been executed first if you do click on the left/right arrow buttons as long as the increment field still has the key focus.
If you first click somewhere on the front panel (no control), you make sure that the value change of increment can execute before you press left/right.
Also, the value changes in the Station Number control are affected by your setting "round to nearest". Depending on the increment value, there can be "unexpected" value changes in this field when altering the increment value.
I cannot say why there is ovbiously a difference between changing increment from big to small and other way round.... but maybe ensuring the value change of increment before changing the Station Number control is sufficient for you.
Norbert
07-12-2013 09:35 AM - edited 07-12-2013 09:37 AM
put the terminal for set station number in the increment value change event to force the ui to refresh the control. use a local to read the value in the Run Value change event.
Mod Attached
(Not sure if this is expected behavior):smileysurprised:
07-12-2013 09:36 AM
Hi,
Please find the attached vi in 2011 version.
Thank you,
Steve
07-12-2013 09:45 AM - edited 07-12-2013 09:48 AM
Norbert_B wrote:the reason for the behavior is that you do not make sure that the value change event for setting the new increment has been executed first if you do click on the left/right arrow buttons as long as the increment field still has the key focus.
If you first click somewhere on the front panel (no control), you make sure that the value change of increment can execute before you press left/right.
Yes, that's the reason. So what are we going to do about it? 😄
07-12-2013 10:02 AM
Hi,
I think that the best solution so far is to add a "Set" button at front panel. Each time after an user update the increment, press "Set" button to update the increment. Then press left or right arrow to set the station number.
Thank you very much,
Steve
07-12-2013 10:07 AM
Shijie wrote:I think that the best solution so far is to add a "Set" button at front panel. Each time after an user update the increment, press "Set" button to update the increment. Then press left or right arrow to set the station number.
That's not a solution because the user is not forced to actually press "set"... and if he does not, you get the old behavior.
07-12-2013 10:17 AM
Hi,
I am wondering whether there is "update value while typing" for numeric control?
Thank you,
Steve