04-15-2011 03:05 AM
Hi all,
I wish to do synchronous time averaging where the signal is acquired if the trigger function detects a rising pulse from a tachometer.
My problem is when I add the current signal and previous signal together, there is no signal output after the add function.
I'm using a shift register to accumulate signals for every iteration.
Can anybody help me in solving this?
Thank you.
Regards,
Hyin
04-15-2011 03:19 AM
Hi Hyin,
adding something to an empty array results in an empty array...
You have to initialize your shift register (or use a case structure to handle the initial iteration). Right now your VI will start with an uninitialized (and thus "empty") shift register!
04-15-2011 03:26 AM
Hi Gerd,
I thought when I add an array with an empty array will result in the array itself. How come it can become zero?
Can I know how to initialize the shift register? I try to add a constant outside of the loop, but it doesn't work as well.
04-15-2011 03:46 AM - edited 04-15-2011 03:47 AM
Hi Hyin,
adding arrays with different size (=length) will result in an array with the smaller size of both the input arrays, so adding with an empty array will always yield in an empty array...
You should use a case structure to avoid adding in the first iteration!
04-15-2011 05:56 AM
Hi Gerd,
I add a case structure to pass the signal out when the iteration number is zero, and add the signal when the iteration number more than zero, and it works well.
Now I can do time averaging alrd.
Thank you very much!
I wish to ask one more question.
I tried to use the "time averaging function" in the signal express before and it doesn't do the right averaging. I mean it doesn't synchronize the signals when it perform the averaging.
Do you know why?
04-15-2011 06:03 AM