08-31-2005 08:47 PM
08-31-2005 09:17 PM
All you have to do is create a VI that is formatted to appear like a dialog box when it runs. On the front panel have the prompt to the user, a numeric control for them to enter the data into and OK and Cancel buttons. Also on the front panel (but not visible to the user) should be a numeric indicator and a boolean indicator. The numeric indicator passes the value that the operator entered to the VI calling the dialog box. The boolean is true of the user clicks the Cancel button. The two indicators are connected to terminals on the terminal pane--the other things are not.
On the diagram, create an event structure. Create two event cases--a value change event for each button. Put the numeric control and indicator in the Ok button value change event case and wire them together.
Have the terminal for the boolean indicator outside the event structure. Put a false boolean constant inside the Ok button value change event case and wire it to the boolean indicator.
All the Cancel button value change event case has in it is a true boolean constant wired to the boolean indicator.
Configure the VI properties to automatically make the front panel open when it's run, and your done.
Mike...