LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a pop up that pause the program (during pop up) and click button to continue OR stop the program

Hi people,

 

I am using LabVIEW to create a testing program to test a power system. The testing lasts for a loop of 90 minutes. 

 

I would like to make a pop up when the testing is completed. When the pop up message appear, the whole program should be paused (NOT STOP) and when the two buttons (continue, stop) are pressed, the program should continue to run OR stop. [To start another loop of testing in order to make sure data collected is accurate and consistent.]

 

How do I make this kind of pop up window? I have totally no idea how to work on this. I will be very appreciated if someone could give me some suggestions/help regarding this.

 

Thank you.

 

Regards,

Vanessa

0 Kudos
Message 1 of 11
(5,547 Views)

Hi,

 

having the program pause while the pop up is open is easy if you understand data flow.

I advise you to take the basic tutorials available here.

 

To create the pop up make a sub vi that you configure to show its front panel during execution (file-> vi prpoperties -> window appearance -> customize, bottom left. NOTE: I don't have the english version of LabVIEW installed, some items in this chain may have different names).

 

Best regards

Florian

0 Kudos
Message 2 of 11
(5,521 Views)

There is a built-in pop-up dialog (Functions->Dialog & User Interface-> Two Button Dialog) in LV, you do not need to create your own subVI for this simple task if I understood your requirements correctly

(if you need more flexibility with the pop up dialog, use the "Dialog Using Events" template).

 

Here is a snippet:

stop_or_cont_LV2010.png

0 Kudos
Message 3 of 11
(5,499 Views)
What you are describing is sort of the default behavior. But in less you want/need something special, LabVIEW had built-in 1- and 2-button dialogs..

Depending on what the rest of you requirements look like that are many ways of creating functionality you describe. A couple weeks ago I wrote a post on starting and stopping a VI programmatically.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 11
(5,463 Views)

Hi Blokk,

 

I tried using your method. However, when the message pops out, the program still runs. I need the program to be paused.

 

Hereby I attached what I have done. 

 

Thanks!

 

Regards,

Vanessa

0 Kudos
Message 5 of 11
(5,421 Views)
Hi people,

I have forgot to mention that my program consists of a few while loops and I wish to pause all loops at the same time.

Vanessa
0 Kudos
Message 6 of 11
(5,409 Views)

You need to communicate between these parallel loops. There are good templates, like the Queued Msg Handler, etc...

A quick and dirty way could be to make local variables of your Pause button, and place them in the parallel loops. When you pause, then all the while loops should pause too. Actually how many while loops you have? You need all of them? What do they do?

 

Edit:

i just had a look on your VI. I recommend you to start some online learning, if you have licence, you can access Core1-2, etc... You are doing the very beginner mistakes, in Core 2 material you can learn how to handle parallel loops (Producer-consumer, queues, notifiers, Event structure, etc...)

You even do not have anything which stops these while loops. Never use the abort button to stop your VI running. Also, the bottom while loop is polling your CPU...you need to slow it down.

0 Kudos
Message 7 of 11
(5,390 Views)

Hi Blokk,

 

In my actual program I have 3 while loops. In while loop A, it is used as counter, to transfer rows of data from an array (row by row) to loop B. For loop B, device drivers are used so that my program can be used to control the devices (it is for automated instrument testing). Loop C is then used for DAQ, data at different test points will be recorded at every second.

 

I would prefer something simple in controlling all the while loops as my program is quite complex.

 

Thank you so much.

 

Vanessa

0 Kudos
Message 8 of 11
(5,376 Views)

@VanessaWen wrote:

Hi Blokk,

 

In my actual program I have 3 while loops. In while loop A, it is used as counter, to transfer rows of data from an array (row by row) to loop B. For loop B, device drivers are used so that my program can be used to control the devices (it is for automated instrument testing). Loop C is then used for DAQ, data at different test points will be recorded at every second.

 

I would prefer something simple in controlling all the while loops as my program is quite complex.

 

Thank you so much.

 

Vanessa


I do not see why you need these 3 while loops. This task could be done with a single while loop, or max 2. Why you need loop A? You could generate data from this array inside loop B. You must use the DAQ and device control part in separate while loops? Maybe you could simplify you code to have one single while loop: at every iteration you could send a new control command to your device(s), and after this do a DAQ measurement.

0 Kudos
Message 9 of 11
(5,356 Views)

Hi blokk,

 

This is because the while loop that contain the device drivers cannot be timed. It will affect the accuracy of data. However, the while loop of my DAQ is timed to acquire data at every seconds.

 

I will try to combine the counter and DAQ while loops together. 

 

Thanks for the suggestion.

 

Vanessa

0 Kudos
Message 10 of 11
(5,326 Views)