Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

About the real time analysis and Error -200279


Hi

 

I am building an application by NI DAQ and measurement studio 2010 with C#.
The basic flow chart about this application is to capture signal, analyze signal ,and then output the result for further software.  The signal is continuously captured by DAQ and the PC compute the signal immediately by my algorithm, and the final result will show on the monitor of PC.  The final output result will be used for some software applications in real time. 

I used the example, MultiFunction Sync - AI and AO, to design my application.  When I finished my algorithm and program, I always got the error -200279.  I tried to found the solution in this forum and by Google, and then I knew this is because my callback function in which I put my algorithm is too slow and the input data could not be written into the buffer continuously.  I improved my algorithm in the callback function and it worked (but not very well). 

 

For example, input sampling rate is 500k and the some relative function setting is as follows.


inputCallback = new AsyncCallback(InputRead);
reader = new AnalogMultiChannelReader(inputTask.Stream);

reader.SynchronizeCallbacks = true;

reader.BeginMemoryOptimizedReadWaveform(150000, inputCallback, inputTask, data);

(when the DAQ capture 150000 samples, the InputRead function would be called. And my algorithm is written in this InputRead function)

 

Capturing 150000 samples needs  0.3 sec.

I made my program analyze these 150000 data and finish my algorithm every 0.3 sec, and repeated it.  But because of some problems like the windows OS busy task or other running software, the DAQ program cannot always get the CPU resource. In other words, my algorithm sometimes can not finish in 0.3 sec, and the error -200279 happens.  I think we can not always make our program finish in specified time, can we?

 

Because my result data would be computed at least 30 times every second, ignoring several output results will not affect my further application software.

 

 

What I want to ask is how to solve this problem?  Is my program flow chart something wrong or are there some good suggestions to help me make it can always run without the error -200279?

 

 

Thanks for your help.

 

B.R.

 

 

0 Kudos
Message 1 of 1
(3,922 Views)