01-22-2013 02:36 PM
Dear all,
I am trying to implement a high-score table, i.e. if some criteria is met, the user has to input a string, which is then written to a file.
Is there a way to implemet a text query at a certain stage in the flow in labview?
Any help is greatly appreciated.
Best wishes
Chris
01-22-2013 02:42 PM
01-22-2013 02:53 PM
Thanks for the quick reply.
I guess the question is: how do I pause the flow until the user has entered its credentials (at runtime) and pressed enter?
many thanks in advance,
chris
01-22-2013 03:03 PM
Ahh, now it becomes more clear...
Maybe you need some pseudocode to help you in writing programs:
repeat check string input
wait for small amount of time until ENTER key or BUTTON press
To make it clear: you would use a loop that stops when your input is given...
01-23-2013 06:59 AM
I would make a new VI as a dialog box to make the user input data into a string control. Use dataflow to "pause" the program while the dialog is up.
01-23-2013 12:39 PM
Thanks, that worked like a charm, at least using the button to stop the loop. The string control is only really writen to a variable once the while loop has finished so that I cannot query if the last value is a carriage return. any ideas on that would be awesome.
Many thanks
PS Screenshot attacht (program was running)
01-23-2013 12:51 PM - edited 01-23-2013 12:53 PM
To solve your problem you could do this: Move the indicator inside the loop. Also right click on the string input and select "Update Value while typing"
However, you could use set focus property on your Done button and let Labview do the work for you. To set this, right click on your button >> Properties >>Key Navigation Tab >> Select "Return" in the Toggle drop down box.
hope this helps.
01-23-2013 02:24 PM
awesome forum!!!! thanks for all the speedy replies. it works great!!!
take care
chris
01-23-2013 03:07 PM - edited 01-23-2013 03:08 PM
Its actually pretty common to use a pop-up dialog box to prompt user for input. In fact its so common there is even an Express vi by that exact same name "Prompt User for Input.vi" which polls the users input.
Of course, Polling should be replaced by Events now that the Event structure is in all versions of LabVIEW so I keep an arsenal of these in my reuse code.
Silly Snippett tool