Averaging 100 consecutive measurements below a threshold value

Hi,
I have just started labview programming. I'm having difficulties with programming just this very simple code. I've been breaking my head all night. I will appreciate a speedy response.
How can I make a code that would enable averaging 100 consecutive measurements that are below a certain threshold value in labview?
Thanks.
Solved!
Go to Solution.

Try the attached.  The key is the shift registers -- the integer (blue) is a counter of below-threshold measurement and it resets to 0 if there is an above-threshold meas.  The result is saved whenever the counter gets above 100 (indicating >=100 consecutive "good" values). This also stops the internal while loop and the external loop causes the shift registers to reinitialize.  I added a "set file position" function so the values will append rather than overwrite the file.  You'll probably need to insert a carriage return into the string that gets written to file so the values will appear on separate lines.  I also changed your data types to DBL -- they were I32 (integer) which does not seem to jive with your indication you were taking analog measurements.
Attachments:
Average.vi ‏13 KB

Similar Messages

  • Average of all values between (first above and last above) a threshold value.

    Currently I have a VI which I programmed a year or more ago, which grabs any value out of a data set that is above a threshold value. This is used for capturing the average of all values over a threshold when there is one peak of values that go above that threshold. However, when there are two or more peaks that go above this threshold, only the values above that value are averaged, so the end result is the average of two or more averages.
    What I need is for every value that occurs after the threshold is reached and before the threshold is dropped below for the last time. Picturing a set of data whose graph looks like the letter "M," for example with the threshold being halfway up the M, I want to show the average of (the first hump, plus the dip below the humps, plus the last hump) but what I'm getting now is the average of (the first hump, plus the last hump). What I get now cuts out the data between the two peaks.
    Any assistance would of course be appreciated.
    Solved!
    Go to Solution.
    Attachments:
    AveAboveThresholdAll.vi ‏15 KB

    Actually I think that Tims solution has a little difference to the stated problem that both limits should be above a threshold value. Since the second array is inverted the rounding should be not towards +Infinity but towards -Infinity in order to really only go up to the last element that is above the threshold. The code as made by Tim takes one sample more, which could or couldn't have any significance.
    Nevermind, I take that back.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to calculate an average of YTD measures?

    Hi all,
    I'm working on BPC 10 for NW.
    We use an account-type dimension for Personnel inventory (Personnel to fixed-term contracts, to permanent contracts, number of executives, staff etc.).
    The corresponding ACCTYPE is AST because people are seen as a balance sheet account measure. So the measure, even if we're in periodic in our model, is stored as a YTD value.
    I want to calculate a average with those measures, for instance the average number of contractors from january to the current month, with a member formula. I can't manage to do that with a calculation because I can't add values of YTD measures: when I try a formula like ([ACCOUNT].A1 , [MEASURES].[YTD]) it returns the same value as the periodic value. Whereas the formula works with EXP account type.
    The formula I'd like to have in the end would be something like that:
    iif(isleaf([TIME].currentmember),avg(YTD(),([Measures].[PERIODIC],[ACCOUNT].[G102])),[TIME].currentmember.lastchild),solve_order=5
    This formula works in a previous version of BPC (5.1) but not in BPC 10.
    Any idea?
    Thanks very much,
    Sébastien.

    Assuming the job always starts at mid-might, you can try something like this:
    WITH t AS
    (SELECT to_date('01-JUL-2011 07:25:31', 'dd-mon-yyyy hh:mi:ss') AS end_date
    FROM dual
    UNION
    SELECT to_date('02-JUL-2011 07:10:58', 'dd-mon-yyyy hh:mi:ss') AS end_date
    FROM dual
    UNION
    SELECT to_date('01-AUG-2011 07:16:24', 'dd-mon-yyyy hh:mi:ss') AS end_date
    FROM dual)
    SELECT trunc(end_date, 'mon') AS MONTH,
            trunc(end_date, 'mon') + avg(end_date - TRUNC(end_date)) AS AVERAGE_TIME
    FROM t
    GROUP BY TRUNC(end_date, 'mon');

  • Managing threshold value of document library

    Hi,
    We are managing below stuff through .net application
    1)Uploading the document  to current Month folder in a document library , While uploading a document check for the current month folder , if it does not exists create a new folder with month and year format.
    2) After uploading a document, storing the file URL in SQL table i.e. through stored procedure.
    3) While retrieving we are using the DB link to display the pdf in application.
    Now have migrated this to SharePoint 2010
    We are using share point 2010 document library, with multiple folders. The library has now exceeded 5,000 items.
    As a result it is not allowing the users to update the documents to a document library, now we are receiving a list view threshold error.
    So now my question is if I increase the threshold value, will it be proper solution?
    After increasing the threshold value, will the performance be affected?
    Please share your ideas/thoughts on the same.
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

    Hi,
    Instead of increasing the threshold limit,finally i felt folder structure would be good enough i.e
    1) Generally for the bulk documents if pretty good enough i.e.
    Uploading the documents in the folder week wise of the document library.
    So in case if there are 1000 documents in the folder, count would be 1 only.
    So this is a good practice for the large number of documents to upload in document library.
    2) Coming to file path,
    After uploading the document, file path can be saved under column of type hyperlink in the list.
    Same folder structure can be followed to save file path in the list
    3) We can fetch the file path from the list to display the pdf.
    Please correct me if i am wrong.
    Regards,
    Naga Sudheer M
    Thanks & Regards, Sudheer

  • Tables for threshold value in GTS 11

    Good morning,
    to get away from our old ERP preference calculation we bought a license for GTS. At the moment we are discussing implementing version 10.1 or even 11.
    I am worrying as I am not sure, how to put data out of GTS to BI (BW) with version 11. We need the price and the threshold value (former table MMPREF_PRO_....) and those for the vendor declaration from supplier and the compression. (LFEI/MAPE).
    Does anybody has experience with getting this into BI? And the "new" tablenames in GTS?
    Hope, my questions are not too dumb, but we are just starting.
    Thanks for any help and have a nice day.
    Rgds Alex Linck
    Kostal Germany

    Hi ,
    Customize as per the path given below for the GTS to BI(BW) data replication.
    IMG : Integration with Other mySAP.com Components >> Data Transfer to the SAP Business Information Warehouse >> General Settings >> Maintain Control Parameters for Data Transfer. 
    GTS > General Setting > Document Structure > Define Document Types Turn on > Transfer to SAP Netweaver BI Active flag .
    GTS > General Setting > Document Structure > Define Item Categories > Transfer to SAP Netweaver BI Active flag .
    GTS > General Setting > Organizational Structure > Control at Foreign Trade Organization [FTO] for SAP NW BI > In the BI Active column, this flag is turned on for active FTOs.
    Ashish

  • RGB and L measurements below histogram suddenly quit

    The RGB and L measurements below the historgram sometimes quit working unexpectedly and give all zeroes wherever the cursor goes on the image.  Quitting Aperture and reopening has usually solved this problem, but I wonder if it's something I'm somehow causing to happen, or it other users have experienced this.

    Thank you.  I have been going back and forth between Pages and Aperture, keeping both applications on the screen, but I hadn't thought to see if the back-and-forth was causing it.  I've been using the viewer.  Is this something that's just a little bug that we need to live with?  Do you close Aperture and reopen as I do to regain the RGB & L values?
    I just did a little test, toggling between Pages and Aperture and then Safari and Aperture, and the loss of RGB&L values did not recur.

  • Design needed to configure certain threshold values by user

    Hi All
    what is the best design in SSIS , where USER wants to configure threshold value at any time . we need solution without any UI development ? Is it possible by only SSIS ? 
    Surendra Thota

    Hi ,
      What do you mean by threshold values here ? If they are where clause filters in query to be applied ,you can consider using Package configurations. With this you can configure the values externally to package in a file, table or environment and the
    package will pickup at run time.
    For more details on package configurations refer below link
    http://msdn.microsoft.com/en-IN/library/ms141682.aspx
    Best Regards Sorna

  • How to initiate a trigger based on threshold value from DAQ

    Hello,
             can anyone please tell me how to start a counter/trigger based upon a threshold value/??i would like to measure the amount of time
    the particular input value is greater than the threshold value...
    I tried out the simple VI attached, but the start time and the end time show the same values... can anyone please suggest/???
    Now on LabVIEW 10.0 on Win7
    Attachments:
    trigger.vi ‏103 KB

    sorry, attached the wrong VI,
    here you go,,, this should work....
    Now on LabVIEW 10.0 on Win7
    Attachments:
    Trigger Counter.vi ‏143 KB

  • CET: %SFF8472-5-THRESHOLD_VIOLATION: Te1/1: Rx power high warning; Operating value: -0.9 dBm, Threshold value: -1.0 dBm.

    Hei
    we have some switches that are connected with our nexus switches via SFP-10GLR. all switches are ok but only one is getting warnings in the logs saying: CET: %SFF8472-5-THRESHOLD_VIOLATION: Te1/1: Rx power high warning; Operating value:  -0.9 dBm, Threshold value:  -1.0 dBm.
    all the SFP,s are same in alle switches.

    %SFF8472-5-THRESHOLD_VIOLATION Vs SFF8472-5-THRESHOLD_VIOLATION.
    The first one is printed for the ports that are configured, but not connected/active.
    You can avoid such error messages simply shutting down unused ports.
    The latter indicates that there is a real threshold violation.
    For more details on these error messages, check out.
    http://www.cisco.com/en/US/docs/switches/lan/catalyst4500/15.1/XE_330SG/system/messages/emsg.html#wp1634341
    Action Plan:
    ========
    Can you please try clearing the interface counters, so that we can notice the frequency of errors.
    Also I researched on the logs that we are observing on our device and have seen cases where the issue has been resolved by physically removing and reinserting transceiver.
    Please refer below link for more details:
    http://www.cisco.com/cgi-bin/Support/Errordecoder/index.cgi?action=search&counter=0&paging=5&links=reference&index=all&query=SFF8472-5-THRESHOLD_VIOLATION

  • CProject 4.0  evaluations - Define Threshold Values

    Hello All
    I need to set the Threshold Values so that the status icons can be showed on the dashboard.
    I followed the installation guide but i wasn't`t so clear for me, the system provides some templates.
    But most of the templates that appears on the 000 client are referred to resource asignment or work accomplishment. At this moment i need to set the alerts by schedule. Meaning that we want to set an alert depending on how far is the real date from the scheduled on task, checklist, etc
    I would like to know if there are any documentation about how to configure this or anybody can give me a hint on this subject?.
    Thank you all in advance for your help
    Regards
    Gaston

    The documentation is a little 'thin' in this area and the 'Define Thresholds' function is a bit strange to use.
    So here's an example:
    Assume that I have created an evaluation that includes planned start date (SCHEDULED_START).
    Create a threshold value based on your evaluation, give it a name and choose 'TASK' for object category (you can leave it blank to mean all objects if you want to)
    Click on the "a/b" button and go into the formula definition.
    In here you build your formula by selecting fields, adding the operators (+ - > < = etc) and entering numbers or strings.
    The example formula below triggers a threshold 5 days after the planned start date where the status is not complete.
    ( Calculated Start Date + 5 ) > Current Date AND System Status for an Object as a String <> 'I1702'
    You can also toggle between this view and the 'Technical' view which allows you to type the formula in directly using field names (example below):
    ( SCHEDULED_START + 5 ) > SYST-DATUM AND SYSTEM_STATUS <> 'I1702' AND TSK_TYPE = 'ZPF_STANDARD'
    Hope this helps
    Paul

  • How to set threshold value for single tablespace in grid control 11g

    Hi,
    I want to set the threshold value for a single tablespace in grid control 11g,
    please provide me a navigation path.

    Sandy wrote:
    Can you please provide me the full navigation path?go to Targets --> Databases
    Select the Database you like to set this alert for
    Select link Metrics and Policy Settings

  • Calculate a measure depending on the value of other dimension

    HI,
    I would like to know if it’s possible to calculate a measure depending on the value of other dimension. I want to calculate this measure in the Business Model and Mapping. I show you how I am trying to do it:
    http://img338.imageshack.us/img338/2496/imagenjp.png
    But when I try to make an aggregation of this measure then I get an error of consistency.
    I think a good example to make you to understand me is the function TODATE which calculates an aggregation depending on one time dimension. I would like to do the same thing but regarding to the value of other dimension.
    Can someone help me? Thanks a lot.

    Hi,
    Do you have that dimension table as a "Sources" in that BMM folder? if yes, then you can use the "Data Type" option and click on "show all logical sources". Then click on your fact table using which you want to do the calculation and then use this formula. After that you can have the aggregation.
    It should work.
    Thanks,
    Rohit

  • Configuration of FP-Modules. In the catalog is something written about sending data on data change. There is a checkbox in the FP-Explorer but I can�t find a configuration menu in FP-Explorer to set the threshold value at which the data will be send.

    Configuration of FP-Modules. In the catalog is something written about sending data on data change. There is a checkbox in the FP-Explorer but I can�t find a configuration menu in FP-Explorer to set the threshold value at which the data will be send.

    : Configuration of FP-Modules. In the catalog is something written about sending data on data change. There is a checkbox in the FP-Explorer but I can�t find a configuration menu in FP-Explorer to set the threshold value at which the data will be send.The FP-1600 modules automatically send data on-change only. The change threshold is by default 0%. Any change, even a single least significant bit change, is sent back to the computer. If the FP-1600 firmware revision supports deadbanding (firmware revision 3.0.x and later, can be downloaded from ftp://ftp.ni.com/support/fieldpoint/Update/FPEthernet0320.zip ). Then on each analog channel or count channel you can specify a percentage change for deadbanding in FieldPoint Explorer. This is done on a channel by channel basis, by right-clicking on the particular IO module and choosing Edit this Device, then choosing Channel Configuration. Each channel (if it supports deadbanding) will have a deadband entry box on the middle right side of the screen).
    The FP-1000/1001 seri
    al network modules do not support deadbanding. The checkbox in FieldPoint Explorer is simply for how FieldPoint Explorer displays the data to the user and does not effect client programs nor the behavior of the network module itself.
    Regards,
    Aaron

  • Adding threshold values in an existing query

    Hi All,
    I have to update an existing query.
    The original query gives me the value of Debtors to sales ratio for each division (DTR value).
    Now, I want that for each division, there be a threshold value which should be compared with the debtor's value and if found higher than the threshold, the result should be in red.
    The result being in red can be done at the front end, which in my case is Cognos.
    But to store different threshold values for diffrerent divisions and then compare them with the debtor's values of the query, do I need to have a separate cube wherein I should store the divisions and their threshold values?
    Or how can I go about it?
    Thanks and best regards,
    Sharmishtha

    Hi Nagesh,
    I do not have those values in the system but will be getting as external data only.
    Divisions and debtors are separate info objects.
    I have 12 debtors KFs (for 12 months) which get filled by an APD (data source is a query).
    So, my final query has divisions in the rows and 12 debtors in the colm.
    So, now i'll be given some threshold debtor value for each division which I need to bring in the query as a KF which can be compared in the query output.
    So, what you suggested will it work in this requirement?
    Also, can you elaborate on the method I need to follow?
    Thanks a lot,
    Sharmishtha

  • Consideration of factory calender in threshold values

    Hi,
    I need to consider the factory calender in the threshold values to check the due date of a task or a checklist item.
    For example:
    The task/or checklist item is due in 11 days (and the factory calender should be condsidered)
    Does anybody know how to implement these checks in the threshold values of cprojects?
    Thanks for your help!
    Isabella

    Dear Friend,
    Ideally you should not change anything on Production server directly.
    The normal & universally acceptable way is to transport the changes from Development or Quality to Production.
    Still if you want to make changes on Production Server Directly (which even i dont recomend) you need to make Production Server in change mode thru T-Codes SCC4 & SE03 & make necessary changes.
    Let me know if you need to know how to use T-Codes SCC4 & SE03.
    Thanks,
    Jignesh Mehta

Maybe you are looking for

  • Report Generation Toolkit Table Row Height-MS Word

    I am having trouble setting the table row height in the report generation toolkit. I can set the column width fine, but the row height seems to remain the same no matter what I set it to. I have attached the VI that generates and formats the table, a

  • 7600GS AGP problem

    I just bought a Gainward 7600GS AGP  with mainboard  nForce2 MSI  Delta2 LSR. after that  my  monitor gets compleatly black from 2 to 2 minutes without any reason ! I  tried to reinstall windows,  install latest nVidia drivers,  nothing. It could be

  • Other Final Cut Pro Discussion Sites

    I'm trying to find other Final Cut Pro discussion sites similar to this one. I know that 2-pop.com is a good one. Does anyone know any others?

  • Hierarchical treeview structure in Reports

    Hi, I am working with an MNC, can anybody help me out by valuable guidelines in doing an hierarchical treeview structure in Reports. Your early response would b helpful to me. Bye Pavan

  • HOW CAN I GET SQL/SERVICE

    Dear Mr./Ms. I browsed the your download Web pages, I couldn't found the ORACLE SQL/Service. Please tell me how can I get this software.I'll be glad to hear from you. sincerely yours YANG Hongyu