01-13-2010 03:13 AM
01-13-2010 03:38 AM
Hi GerdW,
I do seach the forum for moving averaging, and try it somehow still not able to get result. Refer to test.jpg
For moving averaging, i may need to get (t0 to t9)/10, follow by (t1 to t10)/10,...etc & plot to the graph.
If deleted the old data, it just like averaging which not a problem.
regards,
Simon
01-13-2010 08:27 AM
What result are you getting?
The one error that jumps out at me is the way you are replacing the element in the array. For a 5 element array, the index of the last element is 4. (Array indices are zero based.) So it looks like you need a decrement (-1) function on the blue wire after you establish the size of the initial array.
01-13-2010 08:39 PM
Hi Ravens,
You are right. To get the 5 data moving averaging, initial array need set to 6.
Attach with the simulate pic.
Is it possible to get the "Mean" for hex string or still need to do convertion?
thanks and regards,
Simon
01-13-2010 08:48 PM
You aren't taking the mean of a hex string, you're taking the mean of the integer values you converted from the hex string.
The question is whether it is working for you now or not. It seems like you've changed a lot more in that VI than what I told you. You've changed 4 or 5 things.
01-13-2010 09:58 PM
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
You aren't taking the mean of a hex string, you're taking the mean of the integer values you converted from the hex string.
The question is whether it is working for you now or not. It seems like you've changed a lot more in that VI than what I told you. You've changed 4 or 5 things.
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Since the incoming data is normal hex display (23f,..etc) --> convert to hex string --> convert to integer --> Take Mean --> plot to graph. Final result is to get the waveform. Is there any alternatively for better code improvement or remove unnecessary step of my code?? That's the Q refering to.
Yup. Is working now. If based on prev vi, how can need to amend??
Thanks once again for your help & guidance.
Regards,
Simon
01-13-2010 10:16 PM
--------------------------------------------------------------------------------------------------------------------------
So it looks like you need a decrement (-1) function on the blue wire after you establish the size of the initial array.
---------------------------------------------------------------------------------------------------------------------------
How can i do it??
01-13-2010 10:36 PM