Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

AI-AO delay

Hi,

 

I am trying to build simple program that would sample from analog input and play it on the audio output.

I wrote the following code in C# (even though the problem exists in C either) http://pastebin.com/DeQFzkBw and when I am running it on my myDAQ I am having a delay of about 1.2 seconds!

What am I missing?

 

Thanks!

Lev

0 Kudos
Message 1 of 4
(5,289 Views)

Hi levp92,

 

Have you looked at any of the C# examples that come with measurement studio?  There are examples for analog IO there that can help you at this location: C:\Users\Public\Documents\National Instruments\MStudioVS2010\DotNET\Examples .  Hope this helps!

 

Dayna P.

Applications Engineer

National Instruments

0 Kudos
Message 2 of 4
(5,257 Views)

My program is based on this examples, but still has this problem.

Do you have any other suggestions?

 

Thanks,

Lev

0 Kudos
Message 3 of 4
(5,247 Views)

Hi Lev,

 

You are currently reading chunks of 5000 samples at a time.  After you sample all of the data, you are processing all of the data.  Then finally you are displaying it.  Sampling and processing that much data can take a lot of time, and might be the source of the delay.  I recommend reducing numberofsamples down to a much smaller number, such as 5, and then running it, and then see what the delay is.  

 

Hope this helps!

 

Dayna P.

Applications Engineer

National Instruments

0 Kudos
Message 4 of 4
(5,230 Views)