04-13-2014 07:50 AM
Hello guys, I have some problems with making average of value of an analogic signal and calculating percentage of variation from a default value. This is my VI, can somebody tell me what i am doing wrong?
04-13-2014 11:51 AM
Hi wlladdd,
what's the point in adding the very same value several times and divide the sum by the number of addition operations?
And why do you have that "wait for next" in your adder loops? Why do you want to wait for 10s - for a rube-goldberg operation?
THINK DATAFLOW!
- You have to keep values from previous iterations in a shift register to create some averaging.
- You can have shift registers in the main while loop…
- You could use the PtByPtMean function as a very easy starting point…
04-13-2014 03:11 PM
check this , i make a sinewave outside the while loop and add some noise in it. the sampling rate for both sine and noise is 3000 Hz sampling freq and 10000 samples. i then give it to a display and also to a std dev and varinace calc. i put the while loop only to keep the vi running otherwise there is no need as when it tum single time the calc will already be made.
04-13-2014 03:15 PM
04-13-2014 03:39 PM
you have told me before for the flat structure usage and i understand that thing please check your post. furthermore i have already mentioned in my post that this loop is nothing to concern with the vi, so there is nothing like motivating some one to use while loops. please read it carefully.
04-13-2014 04:16 PM
04-14-2014 02:31 AM
Hi wladdd,
using PtByPtMean is as easy like this:
@Tirmizi,
What's the point in showing greedy loops?
What's the point in showing VIs with an unneeded (and therefore Rube-Goldberg) loop?
And additionally: when you show code you should use the autocleanup tool before posting. Nobody likes code examples not following the LabVIEW StyleGuide… (Well, I could have added some comments too! 🙂 )
04-14-2014 11:30 AM
Hello guys, thanks for the answer but don't know to integrate the last exemple in my project. somebody help me?
04-14-2014 02:46 PM
04-14-2014 04:04 PM
@GerdW wrote:
Is it that hard to put a simple PtByPtMean in the wire of your measurement value?
<Standard reply about free training>
3 Hour Introduction http://www.ni.com/white-paper/5243/en/
6 Hour Introduction http://www.ni.com/white-paper/5241/en/
LabVEW Basics http://www.ni.com/gettingstarted/labviewbasics/
Self Paced training for students http://www.ni.com/academic/students/learn/
Self Paced training beginner to advanced, SSP Required http://sine.ni.com/myni/self-paced-training/app/main.xhtml
LabVIEW Wiki on Training http://labviewwiki.org/LabVIEW_tutorial#External_Links
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord