How to calcualte average value

I am using Labview 7.1 with E series card.Iam measuring voltage from a sensor the rang eof voltage is is from 0 to 5 volt. and iam using AI sample. vi to acquire data . iam not using any buffer . but my voltage values are varying very rapidly from 1.23 to 1.26 . when i tested it on MAx i found it gives me avergae value that is not changing. i want to know how can i calcualte the avergae value of my acquire voltage i know the formula of calculating avergae values but how i can apply this formla in this case.

If you do a search on this forum for "running average" you should find some useful info as this topic has come up.
http://forums.ni.com/ni/board/message?board.id=170​&message.id=5008&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=140​&message.id=8505&requireLogin=False
http://sine.ni.com/apps/we/niepd_web_display.displ​ay_epd4?p_guid=B45EACE3EA9756A4E034080020E74861
This last one looks like one of the examples you will see in the LabVIEW "Help/Find Examples" keyword 'average'
Good Luck
P.M.
Putnam
Certified LabVIEW Developer
Senior Test Engineer
Currently using LV 6.1-LabVIEW 2012, RT8.5
LabVIEW Champion

Similar Messages

  • How to calculate average value?

    Hi all,
    I'm using Lumira 1.15. I'm doing some practices with the sample dataset BestRunCorp... I want to calculate the average value of gross margin which is grouped by lines so that I can use a line chart to show the difference between the gross margin value and average value.
    How can I achieve this ?
    Best regards,
    Shuang

    It looks like it calculates the average based on the dimension
    See below:
    If you take the "Best run" Excel file, sort by country, calculate the average in Excel, it matches Lumira's 4,056 (for Argentina)
    I am not sure I follow your divide by 12 logic?

  • How to calculate Average value stock value - MC.B

    Hi All,
    When we execute T code MC.B  we get material analysis report . In it we have a column AVG VAL STOCK VALUE.
    Can some one explain how it is calculated. I see the formula
    The average stock value of the valuated stock is calculated using the formula:
             beginning stock value + n stock value at month´s end
                                    n + 1
    Can Some one explain how it is calculated and what 'N' stands for?
    Thanks,
    Vengal Rao.

    MC.B is inventory turnover.
    In the selection screen you enter how many periods to analyze.
    by default it is today 06/11 to 08/11
    n is the number of periods
    so you have a beginning stock of period 06/11
    + end stock of period 06/11
    + end stock of period 07/11
    + end stock of period 08/11 (which is todays stock)
    so the formula is:
    beginning stock value + 3 stock value at month´s end
    3 + 1

  • Average Values in query

    Hi
    In my query I am unable to average the values in the query is there a way of getting number of records in the query please tell me how to get average values in the query level i went to properties i found the average option but that does not work.
    Regards,
    Nikhil.

    Hi Nikhil,
    Try with the solution detailed in the following document:
    www.service.sap.com/bi --> Product Information Previous Releases --> Media Library --> HOW TO... Guides -->  Guide List SAP BW 2.x -->  How to... Count the occurrences of a characteristic.
    Ciao.
    Riccardo.

  • How to make labview program to get average value of 200 reading from multimeter (by using loop)

    Hello
    How to make labview program to get average value of 200 reading from multimeter (I using using loop) to read voltage from mulmeter  but I like to get average value of all of 200 reding how can I do that?
    Thanks
    Wee
    Solved!
    Go to Solution.

    Another idea with less programming - take advantage of the "free" array that comes with a Chart - i.e. the  History Data.
    1) Wire your DMM data to a Chart. (You can set the chart to invisible if you don't plan on using it in the GUI).
    2) Set the Chart History Length to 200 (right click on the chart, click on Chart History Length...)
    3) On the block diagram, use the History Data Property Node, wire it to Mean.vi, and you're done.
    Easiest running average ever.
    Message Edited by Broken Arrow on 04-07-2010 11:36 AM
    Richard
    Attachments:
    EasyAvg.jpg ‏8 KB

  • How do you find the average value of all the data between two points on a single channel

    I am tring to calculate the average value of all the data points on a single plot between two seperate points
    I have attahced an illustration.
    Tim
    Solved!
    Go to Solution.
    Attachments:
    plot.jpg ‏173 KB

    Hey smoothdurban,
    I've seen Brad's code, and trust me, it's worth the effort to let him help you get it up and running - it's definitely the most ideal way to solve this problem.  However, as Brad said, there are multiple ways to tackle this - both interactive and programmatic - so in the meantime, I'll take a second to detail one of the interactive and sure-fire ways to find the average of data between two points on a single channel.
    We'll use"Flags."  Set up your VIEW graph exactly as you did on your original screenshot, using Band Cursors to approximate the beginning and ending X-values representing the range you want to examine.  Next:
    1. Click the "Set Flags" button () that is a part of your 2D Axis System.  Note that you can hold down the Shift button if you ever decide you want to do this on more than a single curve at one time.
    2. Select the "Flags: Copy Data Points" button that enables after Flags are set.
    3. This creates new channel(s) in the default (bold) group in the Data Portal that contains only the Flagged data.
    4. Select DIAdem ANALYSIS.
    5. Select Statistics » Descriptive Statistics.
    6. In the Channels input, select the newly created channel containing your Flagged Y-Data.
    7. Ensure that the Arithmetic Mean parameter is set.  You can preview the data and the result in the dialog before pressing OK to execute the calculation. 
    You may have noticed that in the Descriptive Statistics calculation, one of the parameters that you can set is the range of channel rows to operate on - so, if you know the row numbers of your beginning and ending X-values, you could just simply run the Descriptive Statistics calculation and use this parameter to operate on a row subset of your original channel instead of the entire channel.
    Derrick S.
    Product Manager
    NI DIAdem
    National Instruments

  • Script logic to calculate average value on nodes - SAP BPC NW 10.0

    Hi experts,
    I need to have in the parent members of the dimension TIME (2014.Q1, 2014.Q2,  2014.Q3, 2014.Q4, 2014.TOTAL) the average value of  their children and not the sum. For example :
    2014.01        2014.02         2014.03        2014.Q1
        1                  2                    3                  2                                          
    2 = AVG(1, 2, 3)
    I tried the script bellow but it doesn't work , it throws the error " ReferenceError : AVG is not defined"
    *SELECT(%TIMESET%,"[ID]",TIME,"[CALC]='Y'")
    *XDIM_MEMBERSET TIME = %TIMESET%
    *XDIM_MEMBERSET MEASURES = PERIODIC
    *WHEN DIM1
    *IS C02
    *WHEN TIME
    *IS %TIMESET%
    *REC(EXPRESSION = AVG(Descendants([%TIMESET%].CURRENTMEMBER)), TIME = %TIMESET%)
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    How can I achieve this ?
    Thanks
    Maha

    The best way is to enter 2 accounts: Productivity and Area, calculating by dimension member formula:
    ProductivityPerHectare=IIF([Area]=0,NULL,[Productivity]/[Area])
    If you have to enter ProductivityPerHectare and Area, then in script you can calculate Productivity:
    *WHEN ACCOUNT
    *IS Area
    *REC(EXPRESSION=%VALUE%*[ACCOUNT].[ProductivityPerHectare],ACCOUNT=Productivity)
    *ENDWHEN
    *WHEN ACCOUNT
    *IS ProductivityPerHectare  //user input
    *REC(EXPRESSION=%VALUE%*[ACCOUNT].[Area],ACCOUNT=Productivity)
    *ENDWHEN
    Then dimension member formula:
    ProductivityPerHectareCalc=IIF([Area]=0,NULL,[Productivity]/[Area])
    You can use arithmetic average of ProductivityPerHectare only if Area is always constant.
    In this case you can create some dummy account member DUMMY and fill it with 1:
    *WHEN ACCOUNT
    *IS ProductivityPerHectare  //user input
    *REC(EXPRESSION=1,ACCOUNT=DUMMY)
    *ENDWHEN
    Then dimension member formula:
    ProductivityPerHectareCalc=IIF([DUMMY]=0,NULL,[ProductivityPerHectare]/[DUMMY])
    Vadim

  • Calculate the average value

    the data I measured changed rapidly, so i want get the average value of the data
    Do not tell me to use mean.vi , i have already know that.
    and i got an idea which is add the data into an array every time, then sum of all the data value and take the result divide by the number of elements
    but i dont know how to achieve that, anyone can build a simple vi to show me ? thank you
    i have attached my vi which is using mean.vi to calc the average value, you can delete it and using in your way ,  thank you !
    Solved!
    Go to Solution.
    Attachments:
    EN-new.vi ‏274 KB

    Hi I got a similar issue for averaging. I used the mean.vi from the math function but the average is rolling when i run it. I am trying to calculate the average for the data i read to the RT FIFO (which is around 40000 lines).I got the writing part working, however, when i am reading the data, I couldn't get it working. I thought i read the data as a 1-D array, and then pass it to the Mean.vi and then got the result. But seems like the mean is only showing the last data in the array.
    Can someone help me with this??
    Attachments:
    FPGA-vi.png ‏242 KB
    RT-vi.png ‏182 KB
    RT-2mod.vi ‏515 KB

  • Average Value Returns as Zero

    I'm trying to take a few readings from an oscilloscope. I made a simple VI to test all of the parameters for the oscilloscope and make sure that everything was working before implementing the oscilloscope in a much more elaborate VI. I want to have voltage at a certain level (say, 2 V) then take a reading from the oscilloscope, add that value as a new element in an array. After doing this 100 times the VI will add the average value to a spreadsheet and then increase the voltage (to 2.05 V or something) and take 100 more measurments and average/record them. I was able to take ten sets of 100-sample averages and write them to an array (see notbroken.png) on one file, but when I try to do it in the real program (see broken.png) I check my spreadsheet and each entry is "0.000." Note that I've also created a program that controls the power supply independently and verified that I know how to control it properly; in fact, the only non-zero column is the one which reads the voltage that the program is telling the power supply to output. 
    I've literally written out each step that my "not broken" program does to find the average value and then done the same for the broken program and I can't find a single discrepancy. Any and all help would be greatly appreciated!
    Solved!
    Go to Solution.
    Attachments:
    broken.png ‏53 KB
    notbroken.png ‏42 KB

    vweltin wrote:
    I've literally written out each step that my "not broken" program does to find the average value and then done the same for the broken program and I can't find a single discrepancy. Any and all help would be greatly appreciated!
    Here's an exact analysis.
    Both of your programs are broken, but the one with the FOR loop iterates only 10 times, thus you get arrays with one nonzero value (the last one) when the loop terminates. (Just because the average is nonzero, does not mean it is correct!)
    Your code with the while loop iterates 11 times, but your array only has 10 elements, meaning that in the last iteration you try to replace an element that does not exist and the array remains at all zeroes.
    In both programs, there will never be more than one non-zero element in the array.
    LabVIEW Champion . Do more with less code and in less time .

  • Average value for waveform chart

    Hello everyone.
    Can i make a time interval, where i can measure average value for a waveform chart ?
    for example fom 0:30 to 0:45
    I have uploadet my VI
    Thanks in advance
    Oesen
    Best regards
    Oesen
    Solved!
    Go to Solution.
    Attachments:
    Trykmaaling.vi ‏83 KB

    Oesen,
    When you are displaying data on a chart, the newest data is appears at the right of the previous data. When the chart history buffer is full (default length = 1024), adding a new point deletes the oldest point.  Visually it appears that the data slides to the left as new data is added to the right end.
    My question relates to how the user would "tell" the program what data to average. In the image you posted you marked a segment of the data to be averaged.  Suppose the user marks point "A" as the beginning of the segment. While the user is deciding where to put mark "B" additional data is acquired and point "A" disappears because it is beyond the history length.  What does the program do in such a case?   A slight variation is the situation where both "A" and "B" have been marked but some of the data is deleted from the history before the averaging or other processing has begun.
    Lynn

  • Averaging values of multiple signals seperately

    Hi All,
    I am attempting to create a VI that will average data over a user defined amount of time (via boolean switch). The attached vi collects data once the "collect Data" switch has been triggered, when the test is over the user triggers the "average collected data" switch to get an averaged value. Please see attached VI.
    THis vi works fine for a single signal. However, the ultimate goal is to be able to do this whole process for n-number of sensors throughout my test loop with a final output as an excel file.
    I am pretty sure that I can get the data saved for an excel file but I cant figure out how to get all of the signals averaged seperately and placed into an array.
    Any help will be much appreciated!
    Thanks,
    Stefan
    Attachments:
    Average Collected Data.vi ‏13 KB

    Stefan,
    When you are doing the multiple signal process, will the collection time and averaging be done for all signals simultaneously or will there be separate Collect and Average controls for each channel?
    If all channels will be done simultaneously, you can probably just make your arrays 2D with each channel in a different column. Each iteration of the loop will store the data in the next row (if Collect is True).
    Notes on your VI: 1. You do not need the sequence structure.  Dataflow controls when things happen.  Your VI will work the same without it.
    2. The two case structures wired to Collect Data could be combined into one.
    3. Building an array inside a loop results in frequent memory reallocations.  As the array gets large this will cause the program to slow down and will fragment memory.  A better approach is to allocate memory outside the loop with Initialize Array and use Replace Array Subset inside the loop where the Build Array primitives are now. You will need to add another shift register to keep track of the next index to replace.
    4. Loops should usually have a time delay to prevent them from grabbing all the available CPU cycles.  Once you put in a real data acquisition process, that may provide the delay.
    Lynn

  • How to calculate averages and send to a file?(source code)

    Having trouble the book isn't very clear on how to use averages.............could some give me an example of a program..................that gets averages and send to a file..........?

    From Deitel and Deitels monster 'How to Program' :
    import javax.swing.JOptionPane;
    public class Average {
    public static void main ( String args[] )
    int total, gradeCounter, gradeValue, average;
    Swing grade;
    total = 0;
    gradeCounter = 1;
    while ( gradeCounter <= 10 ) {      //assuming 10 values
    grade = JOption.showInputDialog ( "Enter grade: " ) ;
    gradeValue = Integer.parseInt ( grade );
    total += gradeValue;
    gradeCounter = gradeCounter + 1;
    average = total / 10;
    JOptionPane.showMessageDialog (
    null, "Class Average is" + average, "Class Average",
    JOptionPane.INFORMATIOIN_MESSAGE );
    System.exit ( 0 );
    Import package java.io
    Three stream objects are created when you execute , System.in, System.out, System.err
    System.out can be directed to send it's output to a file or disk.

  • Curve: average value of the maximum peaks?

    Hi @ all!
    DIAdem 11.1: is it somehow possible to calculate the average value of all the maximum peaks of a curve?
    If yes, how can I make it?
    Thanks for your help!

    Hi Rednaxela,
    Sure, once you have created a channel containing "all the maximum peaks", then you can calculate the average value of that channel either with the CCh() function or the StatBlockCalc() function.  The real question is what you mean by "all the maximum peaks".  Most humans staring at the same data curve will come to similar conclusions as to what "all the maximum peaks" are.  The trick is to define how a computer (program) needs to proceed to come to the same conclusions.  This is actually considerably harder than most people anticipate, because humans are really much better at identifying peaks than computers.  The actual method we use to define "all the maximum peaks" will depend strongly on the details of your data curves.
    Would you be able to post a sample data set or send it to [email protected]?
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • How to view average symbol

    How to view the average value (mean value) symbol (x with line above) in Java Swing?
    Timo Ratilainen

    for a square-symbol, but what is the code for the
    average-symbol???http://groups.yahoo.com/group/unicode/message/5914
    this works for me
    asjf
    import javax.swing.*;
    public class AvTest {
         public static void main(String [] arg) throws Exception {
              JFrame frame = new JFrame("AvTest");
              frame.getContentPane().add(new JLabel("\u0078\u0305"));
              frame.pack();
              frame.show();
    }

  • Average values in SAP BPC for MS 7.5

    Hello!
    I need to make a price list in SAP BPC for MS 7.5.
    So the first question - What type of application should I choose?
    And the main thing - How can I make average calculations?
    I have made account dimension, which member list contains just "Price".
    When I built an input shedule(goods against time), enter prices in some currency,
    the total year value ist the sum of the values of months. But I need an average value.
    How can I organise it?
    Thanks a lot.

    Hi Olga,
    You statement doesnt provide any information on which type of application should be used.
    This decision is based on other criterias. If you need to do any planning or management consolidation, then you can use the financial type application. If you want to do a legal consolidation, then you can use the consolidation type application. If you need to store just the supporting data required for planning, then you can use non-reporting type application (such as rate)
    For displaying average at parent members, either you can write dimension formula in the time dimension for the account price. Otherwise, you can create a custom measure.
    Hope this helps.

Maybe you are looking for

  • Module pool transfer of data from one table control to another

    Hi all, I have been assigned to module pool object wherein i have to display table control on screen and that table control contains only 10 rows on screen for display. Now my internal table it_out has 15 rows Describe table it_out line v_l.     " v_

  • Hide Number of copies in Print Dialog box

    Hi All, I have a requirement in smartform wherein i have to disable the area where we enter number of copies in the Print dialog box, which comes when we execute the program. In the print dialog box we usually enter the output device and can choose v

  • Applet Over DIV tag problem

    Hi, we are using Div tag along wth applet. While loading we want to freeze the screen. so we set width and height for DIV tag. All textboxes and other thngs are going behind the DIV but not working for applets like Browser, Grid. Applets are coming o

  • Wifi: No Hardware Installed after 10.7.3 update?

    I've got a MBP 3,1 which I just updated to 10.7.3 through Software Update with the hopes that the wifi updates would fix my waking from sleep issues. However, upon restarting when I click on the wifi icon it shows in grey text "Wi-Fi No hardware inst

  • Equivalent of the Snow Leopard "Any Recipient" Search

    The whizzy new Lion search functionality in Mail is working fine for me... except there seems to be no way to do an "any recipieint" search. I can search by the various headers individually, but I used the "Any Recipient" search in Snow Leopard const