09-01-2011 09:22 AM
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.
Solved! Go to Solution.
09-02-2011 03:47 AM
has nobody any idea??
09-02-2011 03:59 AM
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
09-02-2011 04:17 AM
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...
09-02-2011 04:50 AM
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
09-02-2011 06:18 AM
Hi Benjamin,
I have LabView 2010. May you save the VI in that older Version?
Thanks
Kolja
09-05-2011 02:37 AM
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
09-05-2011 03:35 AM
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
09-06-2011 02:08 AM
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
09-06-2011 02:19 AM
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