08-19-2010 04:25 AM
I would like to perform data analysis during data acquisition with DAQmx in C/C++. Ideally, I would like to do a similar thing to the example of Circular Buffer in LabVIEW on the NI tutorial document (http://zone.ni.com/devzone/cda/tut/p/id/7188).
I have looked at one of the examples C code, ContAcq-IntClk.c. However, it is not clear to me how I should proceed from here. In the code, the data from the DAQ card is stored in the variable (float64 data[1000]), in the function, EveryNCallback. I am assuming that I should copy the data array into a bigger array in the main() function for analysis. However, since I don’t explicitly call the EveryNCallback function, I can’t send the bigger array into the function. One thing I could think of is to declare the bigger array as a global variable, so that I can use the bigger array in the EveryNCallback function. Am I on the right track? Would there be a better way to do this? I have searched NI web site quite hard, but I haven’t found exactly what I want to know. Any suggestion would be greatly appreciated.
Daisuke
Solved! Go to Solution.
08-23-2010 03:39 AM
Hi Daisuke,
yes you are on the right track. Just insert your N new data elements in a global array on which you then perform your analysis.
Best regards
Andrea P.