LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Self quenching dialog boxes..

Solved!
Go to solution

Not sure which movie but right at the start , the hero will get a small display which reads ... Your mission is xxxx ..This unit will self destruct in 5 seconds ...

 

And after 5 seconds... poof !! ... its gone.

 

Inside of a QSM, i need something like this. I must display a dialog box with just a OK button. If the user does not click the OK in 5 seconds the dialog box must vanish on its own. Will look pretty cool. Anyone done this ??

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 9
(3,132 Views)

Pretty easy. The only code in you dialog could be an Event Structure featuring two cases: one for the Value Change of the OK button, one for the Timeout (being set to 5000 ms).

However it could be better use a For Loop (with a conditional terminal) making the countdown. The loop should contain the Event Structure with a 1000 ms timeout; the Value Change case should output a true value to be wired to the conditional terminal.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 9
(3,121 Views)

@pincpanter wrote:

Pretty easy. The only code in you dialog could be an Event Structure featuring two cases: one for the Value Change of the OK button, one for the Timeout (being set to 5000 ms).

However it could be better use a For Loop (with a conditional terminal) making the countdown. The loop should contain the Event Structure with a 1000 ms timeout; the Value Change case should output a true value to be wired to the conditional terminal.


Maybe the example i have made will explain the problem more clearly : ( It is done in LV2012)

SimpleStateMachine.png

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 3 of 9
(3,105 Views)

Hi Moga,

 

with this OneButtonDialog function you cannot use any timeout, it will wait for user input forever.

But you can implement your own (modal) dialog VI…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(3,100 Views)
Solution
Accepted by topic author MogaRaghu

This will not work, as the One Button Dialog vi will wait for the user click forever.

You need to replace the One Button Dialog vi with your own vi, managing the 5 seconds timeout.

See the attached example.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 9
(3,097 Views)

Thanks folks... that now confirms the simplest way to achieve the Auto Quenching dialog box is to create a VI with the required timing functionality built into it !! 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 6 of 9
(3,088 Views)

The simplest way is to get pincpanter to make it for you 😉

0 Kudos
Message 7 of 9
(3,060 Views)

I thought for sure this was Mission Impossible Smiley Wink

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 8 of 9
(3,039 Views)
Solution
Accepted by topic author MogaRaghu

Mission Accomplished !!Smiley Wink

 

Full code attached as a ZIP file. Unzip and run the Main.vi

 

PS : Any improvements are welcome ! 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 9 of 9
(2,958 Views)