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

Similar Messages

  • Average value of N samples

    Hi,
    I have a problem. I'm reading data continuously from analog input. I want calculate average value when I press button START. Average value should be calculated from samples which are defined by 'Number of samples' and 'millisecond multiple'. When all samples are read, average vale should show.
    The problem is that when number of samples is higher then 10, it doesn't work.
    Can someone tell me what I did wrong?
    Thanks
    P.S.. I saw that there was something like this but I can't open it because I use Labview 8.5
    Attachments:
    Average.vi ‏35 KB

    For that you need to store the previous value for averaging... i have attached a VI regarding that ( sorry no time to cleanup ).. You can use the logic to calculate the average of the samples (Still am not clear about you requirement).
    The best solution is the one you find it by yourself
    Attachments:
    Average_anand.vi ‏26 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

  • How To Concatenate Column Values from Multiple Rows into a Single Column?

    How do I create a SQL query that will concatenate column values from multiple rows into a single column?
    Last First Code
    Lesand Danny 1
    Lesand Danny 2
    Lesand Danny 3
    Benedi Eric 7
    Benedi Eric 14
    Result should look like:
    Last First Codes
    Lesand Danny 1,2,3
    Benedi Eric 7,14
    Thanks,
    David Johnson

    Starting with Oracle 9i
    select last, first, substr(max(sys_connect_by_path(code,',')),2) codes
    from
    (select last, first, code, row_number() over(partition by last, first order by code) rn
    from a)
    connect by last = prior last and first = prior first and prior rn = rn -1
    start with rn = 1
    group by last, first
    LAST       FIRST      CODES                                                                                                                                                                                                  
    Lesand         Danny          1,2,3
    Benedi         Eric           7,14Regards
    Dmytro

  • How to check empty string and null? Assign same value to multiple variables

    Hi,
    1.
    How do I check for empty string and null?
    in_value IN VARCHAR2
    2. Also how do I assign same value to multiple variables?
    var_one NUMBER := 0;
    var_two NUMBER := 0;
    var_one := var_two := 0; --- Gives an error
    Thanks

    MichaelS wrote:
    Not always: Beware of CHAR's:
    Bug 727361: ZERO-LENGTH STRING DOES NOT RETURN NULL WHEN USED WITH CHAR DATA TYPE IN PL/SQL:
    SQL> declare
      2    l_str1   char (10) := '';
      3    l_str2   char (10) := null;
      4  begin
      5  
      6    if l_str1 is null
      7    then
      8      dbms_output.put_line ('oh STR1 is null');
      9    elsif l_str1 is not null
    10    then
    11      dbms_output.put_line ('oh STR1 is NOT null');
    12    end if;
    13  
    14    if l_str2 is null
    15    then
    16      dbms_output.put_line ('oh STR2 is null');
    17    elsif l_str2 is not null
    18    then
    19      dbms_output.put_line ('oh STR2 is NOT null');
    20    end if;
    21  end;
    22  /
    oh STR1 is NOT null
    oh STR2 is null
    PL/SQL procedure successfully completed.
    SQL> alter session set events '10932 trace name context forever, level 16384';
    Session altered.
    SQL> declare
      2    l_str1   char (10) := '';
      3    l_str2   char (10) := null;
      4  begin
      5  
      6    if l_str1 is null
      7    then
      8      dbms_output.put_line ('oh STR1 is null');
      9    elsif l_str1 is not null
    10    then
    11      dbms_output.put_line ('oh STR1 is NOT null');
    12    end if;
    13  
    14    if l_str2 is null
    15    then
    16      dbms_output.put_line ('oh STR2 is null');
    17    elsif l_str2 is not null
    18    then
    19      dbms_output.put_line ('oh STR2 is NOT null');
    20    end if;
    21  end;
    22  /
    oh STR1 is null
    oh STR2 is null
    PL/SQL procedure successfully completed.
    SQL> SY.

  • How to get one value from multiple duplication for a key figure field

    Hi expert,
          I have a infoprovider, with following format:
            employee     hourly_rate   action_type  count of action
         there are multiple rows for each employee, I want to create query as follows:
            employee     hourly_rate   action_type  count of action
         in which hourly_rate is constant , only retriving one value from multiple rows for one employee, count of action should be summarized. 
    how to get this hourly_rate.
    Many Thanks,

    Hi,
    put the employee in rows panel -> reaming object put it in free char panel.
    suppress the all result rows for the all object except employee .
    select the object -> go to query properties -> select display tab -> select result rows -> select suppress.
    select the employee -> go to query properties -> select display tab -> select result rows -> select always display. - now it will give employee wise hourly rate summarize data.
    Thanks,
    Phani.

  • Standard Report to check consumption values for multiple materials

    Hi,
    Is there any standard report to check "consumption" values for multiple materials? The user needs to check the consumption values over a period of time for multiple materials (VERP, ROH) before deciding the re-order and safety stock values for them. Any help on this will be greatly appreciated.
    Thanks,
    Swapnil

    Dear Swapnil,
    Report MCRE is widely used for the material cosnumption than checking in COOIS.
    Also these reports can help you.
    MCPF                 Material analysis: Dates                
    MCPO                 Material analysis: Quantities           
    MCPW                 Material analysis: Lead time            
    Regards
    Mangalraj.S

  • How to create a list based on a value in multiple sheets

    I am trying to create a list in numbers that references a common value among multiple sheets.  I have 4 sheets created for a fantasy football league (1 sheet for QB, 1 for Running Back, 1 for Wide Receiver and 1 for Tight End).  I have assigned a value to each player listed on each individual sheet.  I would like to create a 5th sheet that lists the players in order from highest to lowest value as they are marked on their position sheet.  How would this be done in Numbers?
    Thanks for the help!

    Here is one possible solution:
    I named the four data tables "QB", "RB", "TE", and "WR", and the 5th table, for lack of a better name "Summary".
    NOTE:  The first row OF EVERY TABLE is a header.
    In the summary table:
    A2=OFFSET(INDIRECT(A$1&" :: $A$1"), MATCH(LARGE(INDIRECT(A$1&" :: B"), ROW()-1), INDIRECT(A$1&" :: B"))-1, 0, 1, 1)
    select A2 and fill to the right, then select A2 thru D2 and fill down as needed

  • How do I edit or enter values on multiple sheets at the same time in Numbers?  I can do this Excel but don't know procedure in Numbers.  Thanks.

    How do I edit or enter values on multiple sheets at the same time in Numbers?  I can do it in Excel but I don't the procedure in Numbers.  Thank you!

    The only I way I can think of to modify a single value and have that value change in multipl locations is to have all "the other places" reference a single cell.  There is not way without a referene to modify a set of cells simulateously.
    This may be something like what you want:
    Enter a value in the table "Original Data" cell A1 and the A1 cells of tables Ref1, Ref2 and Ref2-1 will change

  • To display average value in a graph

    Hi There,
    In one graph I need to display the duration for each week as per the week range selected and a separate average duration value of the weeks selected.
    Is it possible to develop a query for above average value and use this query in WAD?
    Can anybody help in providing a solution
    Thank you
    Anima

    BI Query data can be fed directly to WAD Charts.
    See below.
    http://help.sap.com/saphelp_nw04/helpdata/en/0c/95c83956852b51e10000000a114084/content.htm

  • Too many decimals in Average value

    Hi
    I am using Report Builder and the wizard do design a table which i deploy as a .jsp page.
    For some columns in the table I select to display the average values. Some of the values looks fine with one decimal as i want, but some values is displayed with a lot of decimals (about 10) as 164,346666666666666666. I have tried to change the length but without effect. Are there any possibility to decide the number of digits to be shown in the report . Or is i it a bug in Report Builder.

    Go to Property Inspector of the field and choose the right "Format Mask".

  • Creating function to calculate average value

    Hi,
    The below query was successfully return an average value. It returned 1 row.
    SELECT AVG(Volume)
    FROM security
    WHERE
    Type = 'Future' AND
    Rating = 'AAA' AND
    Code = 1 AND
    (Day = ''14-mar-09' OR
    Day = '16-mar-09' OR
    Day = '');
    I tried to use that function on my created function below.
    CREATE OR REPLACE FUNCTION fn_Vol_Average
    ( v_DayLast_1_Week IN DATE,
    v_DayLast_2_Week IN DATE,
    v_DayLast_3_Week IN DATE )
    RETURN NUMBER IS
    v_Vol_Average NUMBER;
    BEGIN
    SELECT AVG(Volume) INTO v_Vol_Average
    FROM security
    WHERE
    Type = 'Future' AND
    Rating = 'AAA' AND
    Code = 1 AND
    (Day = v_DayLast_1_Week OR
    Day = v_DayLast_2_Week OR
    Day = v_DayLast_3_Week);
    RETURN NVL(v_Vol_Average, NULL);
    END;
    I called that function by the following query. it was work, however it return the whole rows. It looks like the function perform the average calculation of each rows on the table.
    Can anyone help me what is going on with the logic?
    select fn_Vol_average('14-mar-09','16-mar-09','')
    from security
    --

    But since your function calculates the average over the whole security table, you wouldn't call this from a select statement which also reads the security table.
    You just want to execute it once.
    declare
       l_vol_average number;
    begin
       l_vol_average := fn_Vol_average('14-mar-09','16-mar-09','');
       dbms_output.put_line(l_vol_average);
    end;By the way, be careful with your date parameters. You should use TO_DATE with a proper format mask to prevent conversion errors.

  • Multiple values for multiple fields sharing common id

    I'm new to Reporting Services and I need to create report based on a common child id that includes multiple values from multiple fields in several tables. I can combine all the values into one query for a list report; however, this causes the rows to duplicate
    multiple times based on the differing fields having multiple values (i.e. report contains various child ids and multiple medication dates/names, multiple health diagnoses with onset dates, multiple health service dates/values, multiple immunization types and
    service dates, etc). If I create a list report and try to use various tables, I run into problems with how the tables view the data due to the duplicating child id rows from multiple field values on that child id. If I hide duplicates for these different tables,
    I can run into spacing issues from the duplicating rows and/or hiding data that shouldn't be hid.
    I need the report to have the basic non-duplicating child info (id, name, basic health info) and then also have various sections that contain fields with numerous values (i.e. section for health issue name and onset dates, section for medication name and
    prescription dates, section for health service name and service date, etc). I would want a page break after each child id and would want all the child ids to be viewed/exported for printing purposes at the same time (i.e. not choosing one child id at
    a time to print or view the data). I have tried to create one main table on a list report with various subreports on the child id; however, this is hard for my machine to process (it takes forever) and I can only view/export one child id at a time when I use
    child id as the report parameter.
    Any help you can give this newbie would be greatly appreciate.
    Thanks,
    Melissa S.
    What's the best way for me to
    MelissaS

    Hi simpson213,
    According to your description, you have some questions about your report design.
    1. How to have non-duplicating child info?
    In this scenario, since you don't want to hide the duplicate data, we suggest you filter the duplicated records on query level by using Distinct statement. If you want to do it on report level, you can group
    records on chid id and use First() function on other fields. 
    Reference: First Function (Report Builder and SSRS)
    2. How to  have various sections that contain fields with numerous values?
    We can also add these fileds into the child group of child and have them toggled by child id. 
    Reference: Add an Expand/Collapse Action to an Item (Report Builder and SSRS)
    3. How to add a page break between each child?
    Right click on the Row Group(child id)->Page Break->Select between each group instance.
    Reference: Add a Page Break (Report Builder and SSRS)
    4. How to select multiple child id when rendering report?
    When creating parameter, select Allow multiple values in General.
    Reference: Add, Change, or Delete a Report Parameter (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How can I compare single value with multiple value...

    Hello,
    I want to compare one value with multiple values, how can it possible ?
    Here in attachment I tried to design same logic but I got problem that when I entered value in y that is compared with only minimum value of x, I don't want that I want to compare y value with all the x value and then if y is less then x while loop should be stop.
    I want to do so because in my program some time I didn't get result what I want, for example x values is 4,5,6,7,8  and y value is  suppose 6 then while loop should be stop but here it consider only minimum number and its 4 here so while loop is not stop even y is less then 7 and 8. So I want to compare y value with all the entered values of x and if y is less then any of x values then while loop should be stop and led should be ON.
    Please guide me how can I do so.....
    Solved!
    Go to Solution.
    Attachments:
    COMPARISON.vi ‏8 KB

    AnkitRamani wrote:
    Thank you very mach for your help..
    may be i have solved this ....i have made one change in my vi that instead of min. i select max and max. value is compare with the value of y and then if y is less then the max. while loop will be stop other wise its run continuously.
    this is working fine...
    any ways thanks again for your help and time...
    I have to agree with Lewis - his way is more efficient.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Display of "Average Values Text in ALV grid"

    Hi
        I use ALV grid to display  the fields from a table. I have 15 columns.  I need to do average for four columns.
    In the field catalog i did a do_sum for those fields.
       When the ALV grid is displayed I get average values for these columns.
    Eg. Let suppose the grid looks like
    Field1           Field2           Field3             Field4     Field5         Field 6.
    vendor1       18                 22                   6            17                28
    vendor1       54                 11                  16           62                28
    vendor1       33                 21                   26          79                18
                        35             18                 16        52             24
      My requirement is I need to display the text "AVERAGE VALUES" . ( I need something like this.)
    Field1                      Field2           Field3             Field4     Field5         Field 6.
    vendor1                   18                 22                   6            17                28
    vendor1                    54                 11                  16           62                28
    vendor1                    33                 21                  26          79                18
    Average values        35             18                16        52             24
    Could someone help me in this?
    Thanks & Regards
    Kavitha

    Hello,
    you can use event subtotal_text of ALV_GRID.
    Regards,
    Pedro Santos

Maybe you are looking for

  • Password Masking & Background Color for Multiple Rows in Tabular Form

    Hi all, I have a requirement of making a column in Tabular form, having multiple rows, masked(password field). I also want to give bg color to this field indicating that its a mandatory field. I am unable to accomplish both at a time in my page. I am

  • How can I perform a bulk assignment to one Task

    Hi All, I would like to allow all resources to assign some of their time to a cProjects Task (XXXX Implementation plan). How can I perform a bulk assignment to this task, instead of performing individual assignments? Please help. Thanks, Srini

  • HT1349 After installing windows 8, I have no sound on my mac desktop. Need help?

    Hi, I recently installed Windows 8 and after the installation there is no audio (sound) in my iMac. I can't hear youtube videos, mp3 files, no nothing. Suggestions to solves this problem?

  • Need Help in JNDI Datasource using tomcat and spring

    Hi, I am trying to connect my local database using JNDI datasource in tomcat and spring I have done the below configuration in Tomcat 7 server: In tomcat server.xml (Path: E:\apache-tomcat-7.0.35\conf) I added the below configuration <Resource name="

  • Structures with group of commitment items ...

    Hi Gurus, I have this query with 3 different structures in rows and each structure has a bunch of commitment items (some are individuals and some ranges) restricted with the KF 0FM_AMOUNT1. Whenever I run the query, the results give me the total for