LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to safely remove USB drive while Labview is open

Solved!
Go to solution

To all the Gurus,

 

I am using LabView 8.5 and have made an Application which requires user to download data from USB drive/stick. So when VI runs user asked to select a .TXT file from USB to download. Here whole operation completes as desired. ONLY PROBLEM I am facing is when download completes User tries to "safely remove USB drive" where windows gives a warning saying USB is in use and cannot be removed.

 

In this particular VI I am using file dialog function to browse through USB and let user select a file. I even tried using open file function but it is giving same error.

 

The only way I can safely remove USB after downloading is by exiting Labview which is not feasible for my application.   

 

is it a Bug in 8.5 or is there any different way to do it?

 

Any type of help will be appreciated.

 

Regards

0 Kudos
Message 1 of 5
(3,609 Views)

Just an idea : after reading the file on the USB disk, try to open/close a file on the hard disk to check if this operation frees the USB disk.

0 Kudos
Message 2 of 5
(3,600 Views)

Thanx for replying JB...

 

I tried it but its nt working...

 

"All the Labview Application Engineers need your help"

0 Kudos
Message 3 of 5
(3,597 Views)
Solution
Accepted by topic author VPM
You can call the SetCurrentDirectory Windows API function (see attachment), but if you follow the link you'll see it warns about using it in multi-threaded apps. I have no experience with it, so I can't comment.

___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(3,590 Views)

Thanx alot TST...

It solved my problem...

my application is now ready to rock n roll...

Robot Very Happy

0 Kudos
Message 5 of 5
(3,574 Views)