LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Input variables into Dialog boxes

Solved!
Go to solution

Hi,

 

I am trying to display an error message if the value the user has entered is outside the allowable range.

I am using a "Prompt user for input" box to then allow the user to enter an appropriate value.

 

The problem I am currently facing is that I need the "Prompt user for input" box to display the limits.

eg. "Unacceptable input please enter a value between 4.12 and 26.78", but these values are not predefined and are dependant on other variables.

 

Is there a way for dialog boxes to accept variables to display?

 

Any help will be much appreciated,

 

Thank you,

Adnan

0 Kudos
Message 1 of 3
(941 Views)
Solution
Accepted by topic author adnan.s
08-27-2015 04:09 PM

Shuddering at the thought of using an Express VI, but let's de-Expressify it a bit.

 

1. Drop your Prompt User for Input VI onto the BD and configure the types of inputs you want.

2. Right-click and select 'View as Icon', no real reason, I just can't stand the look of the expanded view.

3. Right-click and Select 'Open Front Panel'.  Yes you want to convert.

4. Now you have a new SubVI with most of the things you need in place.  On the Front Panel there is a String Indicator which displays the user message.  Change this to a control and wire it to the Connector Pane.  Now you can wire in your own Prompt.

5. Save the new subVI.

 

Personally, I would start from scratch, but perhaps this will do it for you.  I would change from the polling behavior to an Event-based architecture, and selectively enable/disable the ok button depending on the validity of the input, but that is just me.  See if this gets you started.

Message 2 of 3
(935 Views)

... or you could just constrain the valid input range using controls with the "data entry" boundaries correctly set via property nodes.

 

I agree with Darin, a small dialog subVI containg a few numeric controls (possibly showing variable captions) and a string indicator (for instructions and problem reports) should do just fine and would require minimal programming.


LabVIEW Champion Do more with less code and in less time
Message 3 of 3
(928 Views)