LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update Value in Event Structure

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

0 Kudos
Message 1 of 11
(2,683 Views)

Please post the code in 2011 version

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 11
(2,674 Views)

Its working very fine for me.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 3 of 11
(2,672 Views)

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

 

 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 11
(2,671 Views)

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:


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 11
(2,669 Views)

Hi,

Please find the attached vi in 2011 version.

Thank you,

Steve

0 Kudos
Message 6 of 11
(2,668 Views)

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? 😄

 

  • I expect that there will be only a very small selection of useful increments (e.g. 1, 5, 10, 50), so you could use a ring or enum to set the increment.
  • You could also hide the increment/decrement buttons and replace them with real buttons. Keep the station number in a shift register and increment/decrement the value before rewriting it to a local variable of the control.
  • Use a string input set to "update value while typing", do some validity check to see if it is numeric and convert to an integer .
  • ...
Message 7 of 11
(2,657 Views)

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

0 Kudos
Message 8 of 11
(2,646 Views)

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.

0 Kudos
Message 9 of 11
(2,643 Views)

Hi,

I am wondering whether there is "update value while typing" for numeric control?

Thank you,

Steve

0 Kudos
Message 10 of 11
(2,635 Views)