06-02-2010 09:08 AM
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
Solved! Go to Solution.
06-02-2010 09:14 AM
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
06-02-2010 09:47 AM
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
06-02-2010 10:10 AM
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.