LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to build/create a dynamic array for real time data acquisition

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?



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
0 Kudos
Message 1 of 4
(4,390 Views)
Not sure how a timed loop would be used. If you set the sample rate to 1.7kS/s and request 1700 samples, you will get 1 seconds worth of data. If you then request 3400 samples, you will get 2 seconds worth of data. No array creation or size manipulation is involved at all. Post your code. I suspect you are making things far more difficult than it needs to be.
0 Kudos
Message 2 of 4
(4,385 Views)

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.

 



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
0 Kudos
Message 3 of 4
(4,376 Views)

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.

0 Kudos
Message 4 of 4
(4,370 Views)