05-16-2006 11:59 AM
05-17-2006 05:43 PM
05-18-2006 10:54 AM
05-19-2006 05:31 PM
Hi tdk,
Ah, I see that the problem is not really in how you are acquiring the data, but
the rates at which you're acquiring. First off, the typical timeout for a
Read function is 10s, so if you are reading 100 Samples at 10Samples/s, that
means you'll likely get the timeout error. Your options are to increase
the timeout or to try reading at a faster rate.
The 2nd problem appears to be when you are running at 2000 Hz, you want to read
10kS/s of data and log 1kS to disk at a time. This means 10 reads/s;
however, it looks like the buffer is overflowing, so are you really returning
the data that quickly? It could be that the problem is that the logging
to disk is taking longer than you think, which means that a buffer is
overflowing and then you've got a problem.
My biggest question is how are you trying to change the sampling rate and the
output signal? The best way I could think of would be to set up a
waveform in your AO buffer, then to use a counter to generate a variable rate
pulse train. You can also use that pulse train for your analog input and viola;
you've got changing IO rates on both your AI and AO. Just make sure that
you're not reading slower than once per 10s and not faster than about 10
times/s.
The other option would be to keep stopping and restarting the task. This
method could mean that you have breaks in your data though, so it's not as
ideal. The first method though means that you have to have a linear
relationship between the AI and AO. If you were using LabVIEW I could whip
up a few examples for you right away, but I'm not as quick with CVI, maybe if
you let me know more about how you want your measurements to be done I could
make up a bit of pseudo-code for you.
05-21-2006 09:33 PM
05-22-2006 05:22 PM
Hi tdk,
Okay, let's break up that last reply into 3 parts and answer each 1
accordingly:
I know this is a lot to handle. I'm thinking that it
might benefit everybody if you could call in to NI (866-ASK-MYNI) for
support. It doesn't sound like the overall system will be too
complicated, it sounds like the biggest problem right now is making sure that
both sides of this post understand what is going on and the best way to tackle
the issue. If you have plenty of time, then we can keep shooting post
back and forth, but it might behoove you to speak directly with one of our
engineers on this one.
Regards,
05-23-2006 02:06 PM
05-24-2006 04:25 PM
The best way to acquire and
average would be to acquire an array of data and then take the average of that
array. It seems weird that it's not letting you read a defined number of
scans. Out of curiosity if you read the available scans are the samples
being returned about what you would expect considering your sampling rate?
This definitely has something to do with either CVI or the way it's being
programmed. Just in case maybe your project got corrupted I'm going to
include the example that's on my machine as an attachment.
Attachment found here: C:\Program Files\National
Instruments\CVI80\samples\DAQmx\Analog In\Measure Voltage\Cont Acq-Int Clk
05-28-2006 06:40 PM
05-28-2006 07:17 PM