06-17-2017 12:42 AM
here i would like to know for my code that how can we get more than 10 dialogue boxes in labview.?? it is having 1 and 2 and 3 dialogue box .. i tried by placing simultaneously these dialogue boxes but it isn't showing desired response .. any help will be thankful
06-17-2017 12:58 AM
06-17-2017 02:50 AM
so i have to develop a seperate code i.e. .vi file for multiple dialogue boxes and save it as a subvi ??!!
06-17-2017 02:57 AM
Can you perhaps describe what you want to happen, or what outcome you would like, and forum users could advise you on how to best accomplish it in LabVIEW?
There doesn't seem to be a limit, at least on my installation of LabVIEW, to 10 dialog boxes - I called 15 and they just popped up one after the other. However, I don't think this is a good style of coding.
Because there didn't seem to be a limit to number of boxes that LabVIEW allowed me to pop up, I guessed that you are using the "Prompt User" dialog box to get user input, and you were concerned because the dialog only allows a maximum of 10 inputs. Is this correct?
If you want to create your own dialog, with more available inputs, especially if those inputs have a type that isn't string, number or boolean, then yes, you would want to create a new VI file that behaves as a dialog box. This isn't necessarily complicated - you can do it quite easily.
06-17-2017 04:46 AM
You like suggested by cbutcher, you can use 'Prompt User' for up to ten controls of the types number, textbox or checkbox. If you need even more user inputs, you have to write an own VI. Place it in your code as SubVI and use an invoke method to open the front panel just like shown in the VI snipped inserted.
06-17-2017 04:58 AM
Oh and I think you need to close the FP of the SubVI manually before exiting it. Use the invoke method FP.Close for that. Then close the VI-Reference. To transfer the user inputs to your main VI, you should cluster them. So your SubVI has only one output which contains all the data you got from the user.
06-17-2017 05:04 AM - edited 06-17-2017 05:08 AM
It doesn't need to even be that complicated. Attached are two VIs, the first of which just calls the second, DialogVI.vi. In the dialog, I have a cluster of controls and two hidden indicators, and two buttons.
When you press Ok, the first hidden indicator takes the values of the cluster, and the second a false constant for "Cancelled?". If you press Cancel, the first indicator takes default values and the second a true constant. The hidden indicators are wired to the connector pane.
If you wanted to provide a set of initial controls, then you can wire the cluster control to the connector pane as an input. In that case, use a local variable in the OK: Value Changed case to use new values and move the control outside of the Event Structure.
Edit: I forgot to mention the key point here - in the VI Properties, under Window Appearance, you can set the VI to have "Dialog" properties. This sets the values to those appropriate for a modal dialog.
06-17-2017 05:06 PM
I have my own template for making user input dialogs. There is some special code in there for making the window modal or not and only close the VI window if it was called by another VI (does not close when I am debugging it by running it on it's own). No loops required; just an event structure to handle the OK and Cancel buttons.