LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a "terminal" window on LabView 8.0+

Hello,

I currently have a console output and a single line string input that is "functional" as far as replicating a commandline based interface. However, in trying to provide are more consistant interface for end-users I'm investigating any possible way to create such a commandline on the frontpanel of a Labview VI.

I can forsee using queues to handle the async nature of input and output but I can't find any kind of interface primitive that would allow me to write strings and read strings from the same window.

I could also envision having a wrapper around a text input string and text output console that made it appear as if you were typing direct to it - but again I lack some basic frontpanel elements to do this.

Does anyone know of anything that could point me in a helpful direction?
0 Kudos
Message 1 of 4
(3,463 Views)
2 ideas.

1. Use a string control as the input and an indicator as the output, like you said. Color the background of the indicator white and the borders of both transparent. Now use a decoration to put a border around the whole thing so it looks like one box. The drawback here is that you have to type into the control, which is always at the bottom of the box and it might be confusing.

2. Use 1 string control. Put a prompt character such as ">" in the control. When the user enters a command and presses enter read the control after the ">" to get the command. I would use an event structure to filter the Enter key so that the key focus stays on the string control. Remove the command from the string, add whatever output is needed, and put another ">" for a new command to be entered. The drawback of this one is that it's a control and the user will be able to change what's in it. You could filter out any mouse clicks so that if the user clicks the prompt, the cursor always goes to the end, where the new command is entered, but then they won't be able to select text from the output buffer to copy.

I would say the second way would be more natural to a user. I can throw together an example if my description is a little confusing.
0 Kudos
Message 2 of 4
(3,448 Views)
If an example of your second idea isnt too difficult i'd love to see one.

Thanks for the reply.
0 Kudos
Message 3 of 4
(3,437 Views)
I'm glad you asked. I started making something just to see if I could do it. There are some problems that need to be addressed, but this is a start.

- Backspacing past the prompt messes things up.
- This doesn't exactly mimic a regular terminal and keep previous commands shown. To do this you would have to search for the last "> " or keep track of the current line number (probably easier) to get the command.

This is a start to get what you want, but I think it would be a lot easier to just have a control for the command and an indicator showing output.
0 Kudos
Message 4 of 4
(3,427 Views)