LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plug a new usb sound card while LabVIEW is running

Solved!
Go to solution

Hi,

 

I work with some usb sound card to do audio measurements. The problem is that when I unplug a card and plug another one I have to restart completely LabVIEW to be able to use the new sound card.

 

Is there any way to detect and use a sound card plugged while LabVIEW is running ?

 

Regards,

0 Kudos
Message 1 of 16
(4,885 Views)

Hi,

 

i assume that you are using VISA to communicate with your USB devices.  As shown in this post

 you should be able to detect your USB Devices with the VISAfindResource.VI

 

USB Instrument Control Tutorial:

 http://zone.ni.com/devzone/cda/tut/p/id/4478

 

Regards

 

Naitsabes

0 Kudos
Message 2 of 16
(4,840 Views)

Hi,

 

I'm only using the LabVIEW 'Play Waveform' function. It works well until I unplug and replug the USB sound card. Then, if I try to execute the VI again, it fails with this error message : "Possible reason(s): LabVIEW:  (Hex 0x12C0) Selected Device is Invalid".

 

I've tried to change device ID from 1 to 5 but it doesn't work. I'm able to detect the sound card with some 'low-level' functions and use the sound card with 'Windows' but LabVIEW can't send any sound to the card.

 

Thanks

0 Kudos
Message 3 of 16
(4,834 Views)

Hi,

 

at this point, i don't think that you can avoid this behaviour with non NI-Devices, but maybe you could give us some more informations about your application so i can furhter investigate.

 

-Which card(s) are you using?

-In your first post it's said that you unplug a card and plug another one.  Why can't two cards be connected at the same time?

-The seconds post says that you un- and replug the same card.  -> Why?

 

Regards

0 Kudos
Message 4 of 16
(4,794 Views)
Why do you unplug your sound card? If you have to few USB ports, maybe an USB hub can solve your problem. Use the hub for the slowest devices like mouse, and keybord


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 5 of 16
(4,791 Views)

-Which card(s) are you using?

- I'm using M-AUDIO transit USB sound card

 

-In your first post it's said that you unplug a card and plug another one.  Why can't two cards be connected at the same time?

- I need to test a lot of a cards. So even using 4 at the same time wouldn't b enough.

 

-The seconds post says that you un- and replug the same card.  -> Why?

- I would like to be able to change to another sound card or to use the same.

 

Regards

0 Kudos
Message 6 of 16
(4,770 Views)

the problem is, that everytime you'll conecting a new device, it will get a new identifier from your OS. That's part of the USB specs and how the OS is handling new devices.

LabVIEW and other software, can't directly access the new device, this happens only in the initialising step on startup.

 

Have a look at this:

http://www.m-audio.com/index.php?do=support.faq&ID=02efd1f395afa276d4ea08a646e34e90

 

maybe a USB Hub can help

 

Tobias

0 Kudos
Message 7 of 16
(4,758 Views)

HI,

    I am having a simular issue with a USB headset that we are testing using the Labview Play Waveform fuction.  When the device is unplugged and then plugged back in from the PC we have to close Labview and reopen it to again use the play waveform VI to send a tone to the headset.  We have not yet found a way around this and are wondering if you were able to find a solution?  Thanks

 

Scott

0 Kudos
Message 8 of 16
(4,597 Views)
Solution
Accepted by topic author adcpc

Hi,

 

It seems that there is a kind of workaround using this :

http://groups.google.com/group/comp.lang.labview/browse_thread/thread/0976c777e7af1be9

 

I just replaced the lvsound2.dll with the labview 8.2.1 dll and it is working.

0 Kudos
Message 9 of 16
(4,584 Views)

I know this is an old thread, but I have come across a similar problem.

 

I have a program that tests an USB sound device, and I am using the "Sound Device Info.vi" from lvsound2.dll to check if the device has been properly connected. But it has some strange behavior.

 

If the device is connected when I start the program, then I can see the device in "Sound Device Info.vi", and when disconnected it disappears, if I reconnect it reappears - averything is ok.

 

If the device is disconnected when I start the program then "Sound Device Info.vi" cannot see the device. Disconnecting/reconnecting does not make a difference.

 

 

Does anyone know what causes this?

Will it help to replace the lvsound2.dll with labview 8.2.1 version as suggested in this thread?

Where can I get this version of the DLL - I don't have labview version 8.2.1 installed?

 

Hope you can help

Stephan

0 Kudos
Message 10 of 16
(3,718 Views)