12-29-2009 10:26 AM
I am using NI9239 data acquisition module. I need to be able to acquire the data and then report/record only the maximum value for specified time interval. Basically if I am acquiring the data at 1.7kHz, I need to be able to record only the maximum signal value in say 1 second. So I want to create an array of 1700 samples and then find max value and then record/write it to the file. I also need to be able to control the array size in terms of the time, so if I wanna find max signal value for 2 seconds the array size needs to change to 3400 accordingly. I am trying to use timed loop for this purpose.
any ideas guys?
12-29-2009 10:42 AM
12-29-2009 11:23 AM
Thanks for the reply Dennis. Attached is the complete code. I would like to mention that I am trying to modify the example code for my application and in the process the code has grown unbelievably ugly and messy. In the block diagram the part in the timing loop is where I am having trouble. I am not sure if I am using timing loop correctly or even if I need it. All I want to do is with constant acquisition rate of 1.7kHz record the maximum value of the signal for specified time interval during real time acquisition. So it outputs the max value for every 1 second or for any other time interval I set it for. It is kind of decimation scheme I am trying to implement.
12-29-2009 11:37 AM
Sorry, I don't have 2009 installed here.
I have no idea which example you have based your code on. There are numerous DAQmx examples and most do not use the timed loop. As long as you do not request a single sample at a time, the acquisition is hardware timed. As I mentioned, you just have to specify the number of samples and sample rate.