LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I create timed dialog box, so if no selection is made in the pop up within 10 seconds it goes away?

I would like the dialog box to ask the user to select "OK" or "Cancel" if no activity within 10 seconds the dialog box goes away.

Thanks.

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

Have the dialog box VI include an event structure.  An event case each for value change on OK and Cancel.  And a third timeout event set for 10 seconds.

0 Kudos
Message 2 of 8
(3,496 Views)

I am not sure how to draw what you are saying?

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

You can use an undcoumented Windows function (assuming you're using Windows).  It will display a message box for a fixed time ( a value of 0 means it will not disappear).  I posted a zip file of code that calls this function in this thread:

 

http://forums.ni.com/t5/LabVIEW/Displaying-a-popup-message-in-front-of-other-running-programs/m-p/16...

 

 

0 Kudos
Message 4 of 8
(3,464 Views)

@Matthew_Kelton wrote:

You can use an undcoumented Windows function (assuming you're using Windows).  It will display a message box for a fixed time ( a value of 0 means it will not disappear).  I posted a zip file of code that calls this function in this thread:

 

http://forums.ni.com/t5/LabVIEW/Displaying-a-popup-message-in-front-of-other-running-programs/m-p/16...

 

 


I'm not sure that tying the code to a particular platform is the best way to go.

 

Plus, it just seems to be way easier to use an event structure with a timeout.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 8
(3,458 Views)

In 15 years, I have never ported my code to a different platform, nor has anyone tried to port my code to a different platform.  While my case is not indicative of everyone's, the insistence of platform independence is widely overblown since I dare say most of us will never see code moved.

 

What's easier - trying to figure out how to write your own code (especially if it is something you plan to reuse and especially if you are a more inexperienced programmer), or using a canned API function that is already ready to be dropped into your code, offers additional functionality that isn't easily available in LabVIEW?    Not to mention that the message box looks like every single message box a user is used to seeing on the platform.  It supports the standard Windows sounds for a message, the standard Windows icons can be included, and modality beyond LabVIEW is supported as well.


@billko wrote:

@Matthew_Kelton wrote:

You can use an undcoumented Windows function (assuming you're using Windows).  It will display a message box for a fixed time ( a value of 0 means it will not disappear).  I posted a zip file of code that calls this function in this thread:

 

http://forums.ni.com/t5/LabVIEW/Displaying-a-popup-message-in-front-of-other-running-programs/m-p/16...

 

 


I'm not sure that tying the code to a particular platform is the best way to go.

 

Plus, it just seems to be way easier to use an event structure with a timeout.


 

0 Kudos
Message 6 of 8
(3,440 Views)
I would recommend the native function as well.

rico,

Have you taken any of the free tutorials? The event structure is a very basic element in LabVIEW and almost essential in any gui. Besides the events and timeout, you will also want to return status of what the user did.
0 Kudos
Message 7 of 8
(3,439 Views)

@rico_bravo wrote:

I would like the dialog box to ask the user to select "OK" or "Cancel" if no activity within 10 seconds the dialog box goes away.

Thanks.


You also need to define what it should return if it times out.

 

I would also go wit the suggestion of a dialog subVI with an event structure. Simple enough!

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