02-11-2015 01:36 AM
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
02-11-2015 06:13 AM
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
02-11-2015 09:06 AM - edited 02-11-2015 09:09 AM
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:
02-11-2015 11:28 PM
02-15-2015 11:15 PM
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
02-16-2015 12:28 AM
02-16-2015 02:20 AM - edited 02-16-2015 02:27 AM
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.
02-16-2015 03:06 AM
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
02-16-2015 04:58 AM
@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.
02-16-2015 08:33 PM
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