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,
Solved! Go to Solution.
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.
... 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.