LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating control values without mouse clicking elsewhere on screen

It's a property of any control. You don't have to set it for each control though. What I meant was to just set the key focus of one control, preferably a button, to true. This will move the cursor from whatever string or numeric control it is currently in to the button. This will make the last control with the cursor update its value so that you can save all the values. If that still doesn't make enough sense I can make an example.
0 Kudos
Message 11 of 16
(848 Views)

Its not working.

 

I have set the key focus to an arbitrary button when the front panel closes, yet it doesn't seem to accept the value in the numeric control.

Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 12 of 16
(843 Views)

Can you post the VI?

Make sure you are using the error out of the key focus property node to ensure that it executes before you move on to saving the data. If you just put the node beside your other code in the panel close event, you can't be sure in what order it will execute.

0 Kudos
Message 13 of 16
(836 Views)
Okay, I have figured out why it isn't updating. I am reading the control information before the panel close (passing it to the close panel event state via a shift register). So it is getting the old info, before the key focus. I'll redo the code to not write the information to the shift register until after the key focus. But this seems like the correct solution to my problem.
Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 14 of 16
(832 Views)

I just started playing around with this and it works fine for me without doing anything special with the key focus. I simply used the "Panel Close?" event, and wrote a numeric to file in it. When I close the window with the cursor is still in the numeric field after typing a number, it gets saved to the file as expected. What version of LabVIEW are you using that this doesn't work for you?

Edit: Posted at the same time, glad you figured it out.

Message Edited by Marc A on 06-18-2007 02:08 PM

0 Kudos
Message 15 of 16
(832 Views)

Try the following:

1. Create a reference for each control.

2. Bundle the references into an array.

3. Whenever you move your mouse into a control where all others should have been read already, you can set the key focus to FALSE to all controls with a for loop.  

4. You can put this in a subVI that accepts the reference array as an input.

0 Kudos
Message 16 of 16
(404 Views)