04-11-2009 10:14 AM
Hello
Thanks in advance
I have a program written in Labview where I continuously read in voltages using the NI 6210 DAQ unit. I am requiring to store the last n samples (ie say ten seconds of data for example) and perform some mathematical statistical analysis on this data. In my original code I read in six analogue input voltages and using the index array function I separate each channel.
As I am fairly new to Labview, I would guess that I would utilise shift registers, and an array function, but am unsure how it would all connect together and continually update with the last n samples.
Any help would be greatly appreciated.
Skyman
04-11-2009 01:12 PM
Post the code you have so far.
It depends on how often you are reading vs. how much data you are trying to analyze. For instance, if you were collecting 10 seconds of data at a time and analyzing that, then you wouldn't need any shift registers.
If you are reading more frequently then the analysis period, then yes, you might need some shift registers.
But I would also look at the point by point functions in the signal processing palette.
04-11-2009 07:20 PM
My favorite way to get the last n samples of an array (assuming you have the array), is:
1) Reverse the array using the reverse array fn.
2) Get the first n samples using the Array Subset fn (index left blank, which is defaulted to 0, and length set to n).
3) Reverse the output of the Array Subset fn again.
You could hookup the output of that to a shift register and then add new samples to the array on the left side of the shift register.
Code sample (8.2.1) is attached as well as image.
04-12-2009 04:20 PM
Thanks to both of you for your input.
I have attached my latest program where upon I have connected the system as shown by my MattBradley. Just one quick question I am unsure of the input / outputs of the shift register, ie; do I perform the statistical analysis on the output of the shift register, and the input left with the zerod array constant.
Sorry for all this, I do find this help invaluable.
Skyman
04-13-2009 10:56 AM
Matt's example wasn't meant to be just dropped into your code as is. What you have now will take an empty array, append new data to it continuously at an extremely fast rate (not continuous new data, but the same piece of new data over and over again) chopping off the early samples until you hit the "Boolean" button.
His while loop should be your master while loop.