LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I reset a USB drive in a VI?

Is there a way to simulate disconnecting and re-connecting a USB device from within a VI?  During ESD testing, one of our devices is "freezing," and the only way get it back up and runnning is to unplug, and replug in the device.  This is occuring with a LabVIEW built EXE, resetting the EXE does not work. 

 

Any help or suggestions would be greatly appreciated!

 

Thanks,

Andrew

0 Kudos
Message 1 of 28
(5,808 Views)

Hi Andrew,

 

Thanks for the post - I had noticed you've not had any replies... so the least I can do is look into this a bit for you (and generate some activity!).  Which I can look into this more tomorrow when Im back in the office.

 

I am aware you can reset a DAQmx device, but this wouldn't be the same as a full power down i.e. removing the plug. And Im not sure if this could be done as such. I will look into some more tomorrow.

 

A better question / aspect maybe to try and understand why the freezing is happening, could you maybe supply the code AND more details of your application?

 

Kind Regards 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 2 of 28
(5,782 Views)
If you're on a Windows machine you can try using devcon.
0 Kudos
Message 3 of 28
(5,778 Views)

Hi Andrew,                                                                                                                                                                                                                                                                                                                                                                                                                                        Find the attached content.. It is used to remove any hardware from your compuer.... I hope you'll enjoy lot..

Regards : 
Malhar

 

 

 

 

 

Greeting from India,
Malhar
0 Kudos
Message 4 of 28
(5,753 Views)

Hi,

 

I would still advise that you try to find what the root cause of this issue is?

 

Also, me and a few collegues at NI UK weren't aware of any 'offical' method of simulating a full power down/power up (i.e. deeper than a reset).  I am insterested in your upload Malhar, but it didn't seem to contain all the required components. Would you be able to repost/unpassword this, to allow us to take a look?

 

For the record, we have seen the use of devcon before. 

 

Kind Regards,

James. 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 5 of 28
(5,737 Views)

Malhar wrote:

Hi Andrew,                                                                                                                                                                                                                                                     Find the attached content.. It is used to remove any hardware from your compuer.... I hope you'll enjoy lot..


As I noted in this thread, please don't password-protect VIs that you post on this forum.The intent is for people to look at code so they can learn how to do things. 

0 Kudos
Message 6 of 28
(5,720 Views)

The problem is occuring during an ESD test and appears to be at a "lower" level than LabVIEW.  I have error handling to attempt to reconnect to disconnected devices or powered off devices, which works fine, but this one fault requires a full "reboot".  I will try devcon and let you know if I have success!  Any other suggestions are appreciated. 

 

Thank you,

Andrew

0 Kudos
Message 7 of 28
(5,664 Views)

Hi Andrew,

 

Try this when running your ESD test. Rather than unplugging and puggling it in again, try this:

 

1. Go to device manager

2. Right-click the USB port in question

3. Disable the port

4. Re-enable the port

 

If that doesn't do the trick, then I don't know if it would be worth wasting your time trying to programmatically reset the port using LabVIEW. Is it possible that something else is triggering the problem? If your application is simple, would you mind posting a quick screenshot and sharing what hardware, software (w/ versions), and drivers (w/ versions) you have and how everything is set up?

 

Thanks,

 

Dan Richards

Dan Richards
Certified LabVIEW Developer
0 Kudos
Message 8 of 28
(5,631 Views)

I apologize but am unable to post a screenshot of the software, if your recommendation does not work, I will try to create a simplified VI that I can post that exhibits the same issue.  This test is to obtain a CE stamp and requires that the hardware recover, without operator action, from an ESD.  I will also talk to my test engineer to see if he can provide any more details that may be helpful.

 

I greatly appreciate all of your help

 

-Andrew

0 Kudos
Message 9 of 28
(5,609 Views)

Sounds good! Let us know if that works, then you'll know that perhaps there is a way to programmatically get access to the device again.

 

Thanks,

 

Dan Richards

Dan Richards
Certified LabVIEW Developer
0 Kudos
Message 10 of 28
(5,579 Views)