11-02-2006 05:08 AM
11-02-2006 11:37 PM
Hi David,
If you are constantly restaring the tasks or even just the AI task, it would be better to change to continious acquisition since the stop/start task takes lots of overhead. I do not think 100ms is enough time to stop task and restart task. Use the read property node to monitor available samples, my guess is that the buffer is increasing and is lagging the UI. If you log data with a time stamp does the lag show up in the file? I'll bet it does not. If you are persistent on finite acquisition, change the read relative to last sample property.
I had more channels also with encoder doing same thing you are and max rate i could acheive for a sustained amount of time was 1000Hz. By changing to continuous i can acheive 30,000Hz. Huge difference!
Chris
11-03-2006 01:23 AM
Hi, Chris,
I considered continuous sampling before, but my concern was the buffer overwritten error that bothered me in another project. If I don't care about the data overritten, is there any way to disable the overwritten error? I tried a function before that was supposed to do this job but without success.
Thank you very much.
David
11-03-2006 08:45 AM
11-05-2006 06:59 PM
11-05-2006 08:51 PM
Hi David,
I never had any luck with the overwrite function either-maybe its broken!! I do know that the relative function works like a charm though. Some data may be missing (small amounts). DAQmxSetReadRelativeTo(10428) or DAQmxSetReadRelativeTo(MostRecentSample). As i really do not know VB language I'm problaby not much help. Try the DAQmxSetReadRelativeTo(10426) or DAQmxSetReadRelativeTo(ReferenceTrigger) and clock the analog in task on the counter.
How are you setting up the counter clock. I usually use the analog in sample clock to clock the counter. You will have to specify a channel, at least in labview you do.
I wish I could be more help.
Chris
11-05-2006 09:29 PM
Hi, Chris,
I just figured out how to realize a continous sampling in DAQmx ANSI C and successfully avoided the overwritten error with DAQmxSetReadRelativeTo. Thanks a lot.
I used the counter to measure the freq of the input signal connected to the counter gate. I set the counter source to be the 20MTimeBase. Since the input signal freq is no higher than 5K, one counter is enough.
Thanks again.
David