LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enter as data entry terminator fails to trigger event handler

I've encountered a new one in LV2009 (not SP1).

 

I have a numeric control.

I enter numeric data and press Enter. My event handler is not invoked.

I enter numeric data and click elsewhere with the mouse.  My event handler is invoked.

I enter numeric data and press Tab.  My event handler is invoked.

 

Why does LV hate on the Enter key as a data entry delimiter in this case?  Have you guys seen this one in your past with 2009?

0 Kudos
Message 1 of 19
(3,154 Views)

Two guesses:

 

  1. The key is assigned as the control's focus shortcut. That means that every time you press it, the control gets focus. You can right click the control and select Advanced>>Key Navigation to see if this is the case.
  2. You're monitoring the control (or the VI) for the Key Down? event and you're discarding or changing it if it's Enter.

 

If these aren't the case, I would suggest you upload an example VI and after that replace the control with a new control, which presumably will not do this.


___________________
Try to take over the world!
Message 2 of 19
(3,141 Views)

I have a VI with the same problem.  It falls into your diagnosis of reason number 1.  However, I see no reason why this should be the case.  So what if that new control has focus, I still want the update to occur BEFORE the button press of that control is triggered.  Why should this supercede it?

 

I have attached example code.  It consists of pop-up function to collect information, and a wraper program to run (this is a simplified case of what I am using in my main code.)

 

You enter your name, and click OK, things work fine.

You enter your name, and press <Enter>, the 'OK button value change' event fires before the "tester name value change' event; both fire, just in the wrong order.  You can test this by adding numbers in with your name, which the program will not allow.  Hit cancel and it will inform you as such.

 

 

Download All
0 Kudos
Message 3 of 19
(3,083 Views)

 

  • Right-click the string control and select "limit to single line".
  • Remove the key navigation assignment from the OK button. (right-click...advanced...key navigation...)

 

0 Kudos
Message 4 of 19
(3,079 Views)

Also be aware that the OK buttom from the system palette has the enter key assigned by default.

 

If you want that changed, please vote for my idea. Thanks! 😄

0 Kudos
Message 5 of 19
(3,078 Views)

I misspoke:  The 'Enter' key is assigned as the OK button's toggle shortcut key.  If I set the 'Enter' key as the OK button's focus shortcut it actually fixes the problem.  Of course, this is not the workaround I am looking for.  I want my function to behave like every other text input program:  when the user is done inputing the necessary data, the user can just press 'Enter' once in order to continue to save time (and still have data entry error checking occuring properly).

0 Kudos
Message 6 of 19
(3,076 Views)

why is there no option to delete a post??

0 Kudos
Message 7 of 19
(3,076 Views)

Another word of advice:

 

You are annoying a lof of people by attaching a VI set to "Run when opened", so please don't. Thanks!

0 Kudos
Message 8 of 19
(3,071 Views)

 


@altenbach wrote:

Another word of advice:

 

You are annoying a lof of people by attaching a VI set to "Run when opened", so please don't. Thanks!


That's necessary in order to have the function work as a pop-up.  That's why I included the wrapper program to run it.

@altenbach wrote:

Also be aware that the OK buttom from the system palette has the enter key assigned by default.

 

If you want that changed, please vote for my idea. Thanks! 😄


Unfortunately, I want the OK button to be assigned to the enter key.  It's just that LabVIEW decided to trigger my events in the incorrect order when I do this

 

0 Kudos
Message 9 of 19
(3,069 Views)

 


@altenbach wrote:

 

  • Right-click the string control and select "limit to single line".
  • Remove the key navigation assignment from the OK button. (right-click...advanced...key navigation...)

 


And thanks for the heads up on the "limit to single line".  I just noticed I declined to check that after I had posted the example.

 

0 Kudos
Message 10 of 19
(3,068 Views)