LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use string control as terminal window

Solved!
Go to solution

Hello All

 

I am trying to create a terminal window in my VI and to do this i have a string control and a string indicator.

I want the user to be able to write a command in the terminal and when hitting enter the control should update, but not before! I would

like the user to be able to enter multiple commands without having to re-click the control with the mouse, so it has to stay in the

control window. 

The output from this string control is input to a invoke node to an external motor controller, which replies with a string input to the string indicator.

Tried to do some event case, but not quite sure how I am going to detect only the enter command.

 

Any ideas how to preceed?

Thanks

 

Regards

Tommy

0 Kudos
Message 1 of 4
(3,390 Views)
Solution
Accepted by topic author Tombech84

Yeah, in your event structure, look for an event of your string control called "key down"...on the left, there are several parameters coming up (char, vkey etc.) where you can use for example the char to look for char=13 (return).

 

look here: http://zone.ni.com/reference/en-XX/help/371361B-01/lvprop/control_key_down/

 

good luck

 

christian 


THINK G!! 😉
------------------------------------------------------------------------------------------------
Using LabView 2010 and 2011 on Mac and Win
Programming in Microsoft Visual C++ (Win), XCode (Mac)
Message 2 of 4
(3,385 Views)

Hey Christian

 

Dough, i though the key up, down, ect. were the actual up and down keys on the keyboard, stupid me 🙂

 

I setup the control to "update value while typing" and inside my event case i have a case structure with myindicator.

The output from the Vkey is compared with a "return" constant and the output is used as the case selector.

 

Thanks, it works!

 

Regards

Tommy

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

You could use VKey itself as the case selector, that way if in the future you want to capture other keys it will be much easier to expand.

untitled.PNG

 

--
Tim Elsey
Certified LabVIEW Architect
Message 4 of 4
(3,337 Views)