From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lose control value when tabbing into numeric and exiting by key navigation

Solved!
Go to solution

The attached VI demonstrates this.

 

Run the VI, tab into "Numeric", change the value, and Press Enter key.  The value you wrote does not appear.

 

If you exit by clicking "Stop", the value appears.

 

Anybody dealt with this without adding loop iterations?  The Tools >> Options >> Environment >> "End text entry with Enter key" doesn't help.

 

Thanks,
Jason


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
0 Kudos
Message 1 of 5
(3,148 Views)
Solution
Accepted by topic author LabBEAN

Okay, found a work around.  Apply key focus to the Stop button before reading the value of the control.  See attached example.

 

-Jason


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
0 Kudos
Message 2 of 5
(3,145 Views)

Well, you should remove the key navigation assignment between "enter" key and the stop button.

 

Is this all there is to the program, e.g. do you want this to be a popup subVI where you just enter a value followed by the enter key?

 

In this case, remove the stop button and while loop and just leave the event structure and set the event to "Numeric:value changed".

0 Kudos
Message 3 of 5
(3,137 Views)

altenbach,

 

Thank you for your comments. 

 

The actual VI is a dialog with multiple controls inside a cluster.  I allow the user to tab through the controls in the cluster (using Dr. Damien's idea), changing any they like.  They press "Enter" at any point to exit the dialog or "Esc" to cancel.  I then update the main code with their settings as well as the INI file on disk.  I sort of like the key navigation assignments (at the moment).  Assigning key focus to the "OK" or "Cancel" buttons before reading the value allows me to keep the key navigation.

 

 -Jason


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
0 Kudos
Message 4 of 5
(3,112 Views)

As of LabVIEW 2013 SP1 tabbing into a control, changing its value, and using key navigation to exit a dialog still caused the bug mentioned above where the previous value of the control persisted.  I just tried the example posted above with LabVIEW 2014, and I'm no longer seeing the bug.


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
0 Kudos
Message 5 of 5
(2,532 Views)