11-20-2014 04:35 PM
Hello,
I'd like to write a little C# code that reads data from a NiDaq Analog Input channel continuously at lets say 500 samples per second and add them to a buffer. This sampling may go on and on for a few hours or even a day.
One way that came to my mind (I had previously done this but I only needed snap shots of data every few seconds) that I had previously implemented is to have a thread that has a while loop with a delay of 2ms and inside of that loop I read the NiDaq channel using: "analogReader.BeginReadWaveform(...)"
But the way I have current system implemented is by triggering "analogReader.BeginReadWaveform(...)" and then firing an Asynch call back when the read is finished seems to be very complicated specially for a high speed application like this.
Is there an example that shows how to read one teeny tiny sample every couple of milliseconds and add it to a buffer without all this events and callbacks and asynch blah blah that can slow down a time sensitive sampling?
Thanks
11-23-2014 09:54 PM
Hatefk,
Are you wanting to analyze this data in real-time? Or is some delay in the analysis ok, provided the sampling intervals are constant?
11-24-2014 09:00 AM
The data needs to be analyzed in real-time and delays are not acceptable.
But I have started looking at this example: "AcqMultVoltageSamples_SWTimed" which seems to be ok.
Thanks OlliesCamel for the reply.
11-25-2014 01:05 PM
I'm glad you found a solution, but would like to emphasize that a real-time OS would be incredibly beneficial for this application. Otherwise you are certainly going to see jitter of more than 2ms.
11-25-2014 01:47 PM
Thanks but the system needs to run under windows.
04-11-2021 09:34 AM
Dear Alan,
Can you kindly provide me the source , I also want this for a high speed application with PCIe 6321. Please help me