LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Coding suggestion

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 

0 Kudos
Message 1 of 8
(3,331 Views)

Can you explain what you mean a little more? I'm guessing that you're perhaps referencing the "Prompt User" dialog box, and you want more than 10 possible inputs?

 

If so, creating a customised VI and calling it as a dialog box would be an alternative option.

 

 


GCentral
0 Kudos
Message 2 of 8
(3,324 Views)

so i have to develop a seperate code i.e. .vi file for multiple dialogue boxes and save it as a subvi ??!! 

0 Kudos
Message 3 of 8
(3,293 Views)

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.


GCentral
0 Kudos
Message 4 of 8
(3,291 Views)

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.

 

 

screenshot.pngvi snipped.png

Message 5 of 8
(3,278 Views)

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.

0 Kudos
Message 6 of 8
(3,275 Views)

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.


GCentral
Download All
0 Kudos
Message 7 of 8
(3,274 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 8 of 8
(3,227 Views)