ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read string control on pressing enter

I have a string control and a boolean button. The button is the input of a case structure. If TRUE I read the string control and send it through serial.

 

I want to set the button TRUE when I press ENTER (on the keyboard) after I finished typing into the string control.

I want to mention that I already set the "End text entry with Enter key" in Tools>Options>Environment.

 

Best regards,

Dragos

0 Kudos
Message 1 of 4
(5,103 Views)

A much simpler way to do this is to forget about the button and use LabVIEW's Event Structure.  When you press Enter while entering text into a String Control, you change the value that the Control represents.  The Event Structure lets you execute code when a Control's Value changes, just what you are describing.  If you don't know about them, there are a number of tutorials and White Papers on them including this,

 

Bob Schor

Message 2 of 4
(5,100 Views)

I know that´s an old thread. But I´m sure there are lots of people with the same question.

There are two solutions:

 

1. Right click on the button --> Properties --> Key Navigation --> Set "Toggle" to "Return" --> OK

 

2. Do the same thing programmatically (necessary if you want to assign the Return key to another button while the program is running. In this case you can simply use a property node like in the attached example vi.

 

Regards

0 Kudos
Message 3 of 4
(4,504 Views)

test

0 Kudos
Message 4 of 4
(4,464 Views)