LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How-to create auto-updating fields

Hello, I'm having a slight problem with user controlled fields on the front panel. I'm using controls in LabVIEW 8.0, and my problem is that when a user enters a new value into a numeric control field, the control does not update and pass that value throughout the rest of the code unless the user presses the <enter> key while the field is still selected. Seems as though there should be an easy fix.

Thanks in advance.
0 Kudos
Message 1 of 14
(3,480 Views)
Hi BigJWill,
can you please explain what you try to do? If you use an event structure, then you can use the key down event to get every number without waiting for the key.

Mike
0 Kudos
Message 2 of 14
(3,474 Views)
Well to specify, what I'm trying to do is create a program for students to use in and education lab, just for simplicity it would be preferred that they not have to press enter at the end of every string of numbers written into a field. The controls that I'm using are governing for loop parameters; the for loop activates with a mouse down event structure. The problem is that if a student enters that they'd like the loop to perform say 500 iterations one time, and they wish for 300 the next; if they don't press enter after changing the value of the numeric control on the front panel the loop will perform 500 iterations again. I have tried using various types of event structures on the numeric control such as "key up" and "key down" however the same problem arises that they enter key must be pressed in order for the value to update.

I've tried this both on the experiment VI, and a new blank VI with various control-to-indicator set-ups.
0 Kudos
Message 3 of 14
(3,462 Views)
Hi BigJWill,
can you upload your vi to explain it on an example?
Mike
0 Kudos
Message 4 of 14
(3,458 Views)
Thanks Mike, here you go, the issue is with the Scan & Save tab, with the for loop parameters under the scan/save event structure. if you were to set an initial input, final input, and a number of measurements (N Loop interations) the field does not update unless the uses presses enter.
0 Kudos
Message 5 of 14
(3,454 Views)

Hi BigJWill,

in which way should your vi run? Why don´t you use a while loop around your event structure?

Mike

0 Kudos
Message 6 of 14
(3,436 Views)
Hi BigJWill,
I'm not sure what your VI is doing, but I think Mike has something.  Does your VI stop running the first time you create a mouse down event?
Jim

LV 2020
0 Kudos
Message 7 of 14
(3,432 Views)
Well the VI is set-up to run when opened, and I didn't place a while loop outside of the event structure because I didn't want it to be executing code which waited for an input for the user. The event structures I've set up initiate upon the users pressing of buttons on the front panel.
0 Kudos
Message 8 of 14
(3,424 Views)
Instead of the Mouse Down event, try using the value change event.  LabVIEW appears to handle the control's value change before the value change of the button.  I would also swith your buttons to latch and read them in their event, so they reset to the off state.
0 Kudos
Message 9 of 14
(3,421 Views)
Even when the event structures are used with value change, the control does not actually change and update the value until one presses enter
0 Kudos
Message 10 of 14
(3,416 Views)