10-16-2015 07:42 AM
Is there a way to "prepopulate" a popup to the user? I query the user for 6 different values using "prompt user " express.vi. At the end of the 6th query I display the values the user put in and ask if they are correct. As of now if he/she hits yes the vi ends and continues on in the main program. If he/she hits no the subvi repeats itself and asks for all 6 values again. The user has requested that I "pre-populate" each popup and the user just hits OK for each individual popup if that value is correct. Conversely they enter the wrong values then hit OK. Can't figure out how to have zero in for the 1st time thru the subvi and then the pre populated values in if the user hits no.
10-16-2015 07:45 AM
Please post the VI you have already developed (as a .vi or a LabVIEW snippet, please) -- it will save us a lot of our time (which you get for free) ...
Bob Schor
10-16-2015 07:56 AM
here ya go...and thanks.
10-19-2015 03:31 PM - edited 10-19-2015 03:32 PM
Hi Clint1000,
After doing some digging, it looks like that behavior is possible but would probably be more trouble than it's worth. Because you are using the default 'Prompt User for Input' Express-VI, you would need to customize each VI for each prompt, so 6 individualized VIs. In order for the new values to display when it's opened, you could save the values the user inputs to be default for that control so the next time it opens, it would display that value. If you want to do that, this article discusses how you could do that: http://digital.ni.com/public.nsf/allkb/6AE789BED0E8161E862571E60069F9BB
Then the next time the loop ran, the defualy value would be in the control. However, this may be a lot of work just to avoid having the user input 5 numbers again.
Hope this helps,
10-19-2015 05:17 PM
I would say it is simpler to edit "Prompt User for Input" VI - open front panel, save it as a custom VI. Assign input controls to connection pane - make them real inputs for the subVI. Then you can connect anything you want to the inputs - VI will open with these values.
Note: It is easier to join values into cluster - 2 connections instead of 12.
In the main program save them manually. If you need to keep these values between runs - ini file, otherwise - shift register.
imho saving variable values as default within VI - bad idea.
10-20-2015 04:21 AM
So from the 2 posts the consensus is it’s a bad idea for whatever reason to have the fields populated if the user choses "No" when asked if the info is correct? Just wanted to make sure I wasn't missing something. Could have sworn I saw something like this as an example vi..guess not.
Thanks..
10-20-2015 09:03 AM - edited 10-20-2015 09:06 AM
Having control over initial values for the dialog is a good style and common task.
I have not tried to store them right in the dialog vi (as ahillinaustin suggests), may be this is why I think this is a bad idea.
*For example I doubt it will work in the executable - you need to save VI with new values for the next run.
10-20-2015 10:04 AM
10-20-2015 10:14 AM
Instead of a bunch of popups (annoying) why not just make one vi that has six data entry controls with one "OK" button.
You can put the default values or zero in the controls.
Then use the same conformation popup vi you have.
Also you can get rid of all the flat sequences and your program will still run the same due to LabVIEW's data flow.
10-20-2015 10:31 AM
writting a custom vi was my next approach. I was trying to save time by using express vis..
Thanks.