LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generate white noise while switching outputs

I am trying to generate and play white noise through the sound card at the same time as switching up to 9 digital output ports. The digital outputs work OK, but the white noise 'stutters', and gets worse the more digital ouputs are used. Does anyone know how to configure things so that the sound will play continuously regardless of how hard the rest of the program is working at producing timed digital outputs?

I will attach my vi to this post. It is very much a 'work in progress' but will give an idea of what I am trying to do. The card I am using is a PCI-6221 (37 pin).

 

Thanks,

Brad Dawson

0 Kudos
Message 1 of 3
(2,745 Views)

Brad,

 

i asume that the 'stuttering' is created each time you repeat the loop. This is somehow expected behaviour. You have to break up the task into two different loops.

Please take a look into producer/Consumer framework for further information on possible architectures.

Additionally, i recommend you to collect all digital lines to single ports and write values as U8/U16.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 3
(2,733 Views)

First of all. You are abusing local variables. Do not use them in this manner. I have also a hunch that it is more room for improvement in your code. But I have never used Labview with digital I/O so I can not advice you.

So regarding the sound problems. The Labview 8.x, and 9.0 sound system is a big disappointing and full of bugs. The sound get bad if you update the sound output more than 5 times pr second. The older system used in Labview 7.x was much better. But anyway your update rate would never have worked very well neither in 7.x or 8.x. The update rate is to fast. I have changed your program somewhat. I can not test it. But now it should play sound chunks of .5 second. The sound length must be a multiple of .5 seconds. With this solution I think you can use both 16 bits and higher sample rate if you need it.



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