LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update Audio Devices while program is running

Solved!
Go to solution

Hi

I want to connect an audio device while a labview VI is running. When I do so, the audio device doesn't appear in the audio device list. Is there any activeX node or other possibility to refresh the audio devices in labview while a VI is running?

I'm using Windows XP and LabVIEW 2010, but I think an upgrade to 2011 wouldn't solve my problem.

0 Kudos
Message 1 of 12
(3,403 Views)

has nobody any idea??

0 Kudos
Message 2 of 12
(3,391 Views)

Hi da_kolle_87,

 

I found a resource that may be of interest for you. Take a look here: http://lavag.org/topic/12822-getting-a-list-of-sound-devices-in-the-system/

 

Still researching on this problem by myself a bit right now. I'll post some update in case of any news.

 

Best regards,

 

Benjamin

Message 3 of 12
(3,388 Views)

Hi Benjamin,

 

yes, I saw this page before!

What is LabVIEW doing when it starts, to get the information about the audio devices? I think it has to look in the registry or the device manager of Windows or something like that. But this has to be possible while a VI is running. I will have a look at the ActiveX nodes and Applicationreferences for a second time...

0 Kudos
Message 4 of 12
(3,382 Views)

Hi da_kolle_87,

 

I constructed a little example extracting the number of sound in- and outputs using the mentioned VIs. If I plug/unplug a device during runtime of the VI, the numbers don't change. If I close the VI and open it again after changing the number of plugged devices the numbers change.

 

LabVIEW thus grabs the information on available soundcard during the VI loading process. Maybe this provides you some helpful info.

 

I'm going to research a bit more. Keep you updated.

 

Best regards,

 

Benjamin

0 Kudos
Message 5 of 12
(3,377 Views)

Hi Benjamin,

 

I have LabView 2010. May you save the VI in that older Version?

Thanks

 

Kolja 

0 Kudos
Message 6 of 12
(3,369 Views)

Hi Kolja,

 

saved it as LV2010. The VI itself is not a big deal though. Only thing it does is to use the "Get Num Devices" function. Still useful to diagnose whether or not and when soundcard in/outs are detected.

 

Best regards,

 

Benjamin

0 Kudos
Message 7 of 12
(3,345 Views)
Solution
Accepted by da_kolle_87

Hi Kolja,

 

just talked to a colleague about the issue and we solved it now. The solution are VI references and reference calls.

 

Take a look in the example in the attachment. Using this piece of code the "Get Num Devices" function (as an example for every other function you wish to use) is reloaded everytime it is called, resulting in updated device counts at runtime. 🙂

 

Good luck using it and best regards,

 

Benjamin

Message 8 of 12
(3,339 Views)

Hi Benjamin,

 

great one! It's runnning!

But it's ununderstandable for me why LabVIEW doesn't look for itself for new devices...

 

Best Regards

 

Kolja

0 Kudos
Message 9 of 12
(3,324 Views)

Hi Kolja,

 

good to hear that it helped!

 

And: LabVIEW does look for new devices, but obviously just once during compile time (during vi startup). 😉

 

Best regards,

 

Benjamin

0 Kudos
Message 10 of 12
(3,320 Views)