LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display Message and Idle

So I am not sure if there is a way to do this or not, but when using the "display message to user.vi" (or the prompt user for input.vi) is there a way to code it so that if there is no input after 5 mins, it will run a different section of code?

 

My programs mostly all control some sort of function generator, and require user input while the signal is still applied (so that you can see the levels on the voltmeters when the message pops up) but if the technician isn't in the area (because some of these tests take all day to run) then it will just sit idle with the signal on, and I would like it to turn itself off if no one is there.  Maybe there is a way with a case structure...  I made a picture in case what I want is not clear.

0 Kudos
Message 1 of 4
(2,132 Views)

That VI has no "timeout" input. You will need to write your own VI. You can get started by right-clicking on the Express VI and selecting "Open Front Panel". Then you can save the subVI under your own name in your own project and add in a "timeout" input.

Message 2 of 4
(2,121 Views)

Thanks for the suggestion, I tried opening up and have a decent idea of how to do this but it doesn't seem to work.

 

I put a user controlled timer in with the dialog boxes that return a true value when the time is up, and a boolean "or," but it doesn't seem to be working when I run it off the front panel, it just sits on the dialog box as usual.

0 Kudos
Message 3 of 4
(2,104 Views)

You won't be able to use the built-in dialog VIs since those are modal. You have to actually create your own dialog VI. This means you need to have a front panel that has a string indicator to display the message, and the "OK" and "Cancel" buttons (or whatever buttons you want). Take the VI you have and place a large string indicator on it. Wire the message to display to it so you get the message. Then plop down a couple of buttons. Then sit in a loop with an event structure (or just a simple loop, but don't make it a Greedy Loop) checking for the time and whether the buttons were clicked. You can either hide whatever other input controls you have for the VI, or shove them out of the way and resize the window.

Message 4 of 4
(2,098 Views)