LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Aborting tests while in a measurement loop if a failure occurs

I have a CVI program that I perform numerous test measurements while in a loop. I want the ability to abort this measurement loop if a failure occurs by pressing a "Abort" control on the UIR.
I called the support line and they told me to put in a ProcessSystemEvent call, but that won't abort the test.
The procedure that does these measurements is called from the callback procedure for a "Start" control and I don't return to the callback until all testing is done.
0 Kudos
Message 1 of 3
(3,105 Views)
I have such an application for vibration measurement. To do a safe stop of
the hardware, avoiding untended reboots, screens of death, etc, I first
have:
ProcessSystemEvents(); // numerous, throughout the program,
then
DAQ_Clear(ADHardware.iDevice); // the hardware A/D writes to memory must
be stopped before memory is freed
then DiscardPanel () // assuming you want to do this
and then all dynamically allocated memory is freed .

This works cleanly.

Duncan
0 Kudos
Message 2 of 3
(3,105 Views)
What you have to do is to put ProcessSystemEvents into your while loop (this makes sure that events can be handled), place a Command Button on your Panel with which you can abort the loop and in this callback function update a variable which disables the loop construct.
Please see attached little sample program.

Regards,
Heinrich Illig
Applications Engineering Manager
National Instruments Germany GmbH
Download All
0 Kudos
Message 3 of 3
(3,105 Views)