LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error -20308 using Sound input VI

I am unsing the LabView sound input example.

I am measuring a 1 kHz tone on the microphone input.

I get Error -20308 which I suspect is a error due to the sampling rate.

 

How can i modify the program so if enough samples are not ready the VI will load more and not error out.

 

 

labview sample error.jpg

 

0 Kudos
Message 1 of 8
(4,296 Views)

There are a few options:

WaveformSize.png

 

The bottom two are based on the number of samples, the top one uses the dt to get the duration of the waveform in seconds. Because you have an array of waveforms (two channels), you'll need to index out one of the waveforms first (I think).


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 8
(4,289 Views)

Please, show your read settings and use vi snippet.

0 Kudos
Message 3 of 8
(4,287 Views)

OK here is the snippet. I have never done a snippet before lets see if this works.

 

sound input snippet.png

0 Kudos
Message 4 of 8
(4,265 Views)

Did you see any signal on Waveform graph?
This code work if sound enough loud.

0 Kudos
Message 5 of 8
(4,248 Views)

The program works as long as there is a signal to measure.

But if the signal goes away the program errors out.

 

I need the program to keep running and report the frequency as 0 Hz.

 

Is that possible useing the Express VI?

 

I was thinking it was a sample problem?

 

Any ideas guys?

 

0 Kudos
Message 6 of 8
(4,234 Views)
Did you look at my answer? I gave you multiple methods to work out the length of the waveform. Of course, if the data you have doesn't actually make the transition (i.e. if your threshold is too low/high) then the express VI will return an error - if it errors, you can put a case structure and wire the error wire to it and inside the error case, wire a 0 to your frequency.

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 7 of 8
(4,217 Views)

I will try that today, thanks.

0 Kudos
Message 8 of 8
(4,205 Views)