LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop IMAQ-USB session when execution stops

I am using the IMAQ-USB driver to aquire images from a USB camera. This works aquiring from both USB and DV25 firewire cameras as long as I exit my program by stopping the while loop and allowing the USB session to close. If I click on the stop execution button on the menu bar (red octagon) then the execution stops immediately,  and the session doesn't close. This consitently results in a  crash and a LabVIEW reboot. This also happens when there is an unrealetd error in teh program and I have to stop the execution.
 
I am using:
 
LabVIEW 8.0.1
Vision 7.1.1
IMAQ for USB cameras 1.1.1
Windows XP (English)
 
Code attached....
 
Thanks
 
Tom
 
0 Kudos
Message 1 of 3
(2,495 Views)
Hi Tom,
 
You shouldn't really stop a LabVIEW vi with the 'Abort' button on the toolbar, and the problems you are having is exactly the reason why - because it can leave hardware sessions in an unknown state which are difficult to recover from.
 
Instead, you should use the stop button instead, and the user should always stop the application in this way. You've already got one of these in your application, and are rightly closing the USB camera session correctly.
 
If you want the program to stop correctly in the event of an error, then you can use the 'unbundle by name' function on the error cluster inside your while loop (after the IMAQ USB Grab Acquire function), and unbundle the 'Status' part of the error. You can then 'OR' this with your stop button, so your program will stop if there is an error or if the user clicks the stop button.
 
I hope this helps, let me know if you have any questions.
 
Hannah
NIUK & Ireland
Message 2 of 3
(2,488 Views)
Thanks, that's really helpful and should prevent LabVIEW form crashing on errors and I suppose I'm just going to have to restrain myself from using the abort button.
0 Kudos
Message 3 of 3
(2,482 Views)