with an average of 100 consecutive measurements below a threshold value

Hello

I just started programming labview. I'm having difficulties with just this very simple programming code. I was breaking my head all night. I'd appreciate a quick response.

How can I make a code that would allow an average of 100 consecutive measurements which are below a certain threshold value in labview?

Thank you.

Try the joint.  The key is shift registers-(blue) integer is a counter of deca thresholds measures and it returns 0 if there is a measure above threshold the result is saved whenever the counter is greater than 100 (indicating > = 100 consecutive values of 'good'). This also prevents internally while loop and outer loop causes the records to shift to reset.  I added a function to "define the position of the file" then the values will be added rather than overwrite the file.  You will probably need to insert a carriage return in the string that is written in the file so that the values appear on separate lines.  I also changed your data types of DBL - they were I32 (integer) that doesn't seem to jive with your indication that you take analog action.

Tags: NI Software

Similar Questions

  • two consecutive measures of distance

    Hello everyone,
    I want to take two consecutive measures of distance, let's say that the first is a second one is B and then I have to do A / B
    Please find below the program

    This is two method for your application with holding the CTRL and draw two line King

    second without using ctrl for line

    See both of them and choose with it's better for you

    Best regards

    Gerard

  • With an average of a spectral waveform and view / save

    Hello world!

    I am currently on a University project that consists on the use of Labview to obtain data and spectra of atmospheric plasmas using a spectrometer Ocean Optics HR4000.

    After not not using Labview for almost a year, I managed to get most of my knowledge back and I managed to display the spectral waveform, that I expect to get. However, as this is a fairly simple design I get a lot of noise and I would on average it for a graphic display more smooth.

    I looked into a lot of messages from the forum, but I couldn't really find what I was looking for.

    I also had a problem when you try to save the data and Spectra: I can't find anything in the directory of my VI.

    In the attachment you will find the current VI I'm trying.

    Thanks in advance for your answers!

    Jeremy

    I wrote an example for you below. This is an excerpt from VI, so you can drag the .png in your diagram and it becomes code. Pretend that everything in the green box is your Subvi spectrum acquisition.

    -Place the Subvi in a loop to run as many times as you like on average there

    -Out of the loop For is a table 2D with individual spectra on the lines

    -Transpose output, so individual spectra on the columns

    -Enter the table another loop to take the average rank by rank (with an average of different Spectra togeter).

    -Output is 1 d spectra average table

  • Covered wagon with an average of analog voltages DAQmx

    I searched through screws, I can't seem to find something that will automatically average numbers of boxcar fed into it. I am trying to create a feature of my software that will allow the dynamic configuration of the car covered with an average of some inputs. I would like to avoid hard-coding tables which are filled/rotation etc etc.. Any help is appreciated

    Thank you

    If you use a Functional Global to store the values and call that VI of two different screws, you will access the same data. You could use two Global in the functional shift registers and use a selector to place / extract data from / to the appropriate shift register. Only VI call access one commune VI at the time, so one of the caller of the screw will be 'blocked' until the first caller is done. This does not usually work for data acquisition applications high speed.

    You might consider using named queues instead of functioning overall. You might be interested in this thread on the forums of LAVA that deals with boxcar implimentations. You create a queue for each data stream and can perform functions such as "preview" queue to get all items without actually removing them from the queue. If you use a LabVIEW 8.6, there is a new feature called with loss of queues. You set an upper limit on the size of the queue and "lossy enqueue" allows to add items at the end of the queue. If the queue fills up, then the oldest data element will be lost.

  • PT-100 resistance measurement


    Hi Raghunathan,

    You can find the following links to help you:

    Take measurements of temperature with the RTD: practical Guide

    With an RTD or thermistor temperature measurement

    In addition, it would be useful if develop you your condition a little more each time you post.

  • with an average of 5 minutes of data - is no way

    I need average 5 minutes worth of data, save this average and then again on the next 5 minutes of data, with an average of this data block.  I tried to use the average function pt-pt in LabVIEW, but who seems to take an average continuous market, I do not want.  I probably read data once every 0.1 seconds, so I can not used stacked registers at offset, because it would be not very economical. I thought to build a table, but I don't know how to remove all the data at a time on average to it in an efficient manner, and more I'm stuck on the concept of re - create the table/clear the Board after five minutes of data has been collected, averaged and recorded.

    Does anyone have a suggestion?  I would really appreciate any advice or suggestions on how to go about it.

    Keep a running total in a shift register.  When your 5 minutes have expired, divide the sum by the number of samples taken, the sum to zero and start over.

  • How can I create images with lightbox which are 100% width

    With Dreamweaver, I use Lightbox JS 2.0 to take pictures on my Web site. But whatever I do photos are always too big. I create of course with a width of 100%, but on my screen, they are about 200% and so they are a little blurry.  I'm doing something wrong, or is there a way to prevent this?

    Well, your layout of the web site is not responding.  Its width fixed in pixels.

    And Lightbox container seems to be wide 1020px.  So it isn't an ideal layout for small users of the device that needs to scroll horizontally.

    If you want to reply, watch this DEMO of Bootstrap.

    Bootstrap Modal + Carousel Gallery - http://alt-web.com/

  • I am facing a problem with the beep.vi. I have a DAQ program, which acquired the signal and compare it to a threshold value. When a signal is out of range, a Visual and sound alarm has occurred. I use the VI beep.vi to generate the sound.

    I am facing a problem with the beep.vi.  I have a DAQ program, which acquired the signal and compare it to a threshold value. When a signal is out of range, a Visual and sound alarm has occurred. I use the VI beep.vi to generate the sound. Everything works fine except the sound alarm. It gives the table 1 d of type mismatch. I tried to fix this by placing it in a box structure. But it still does not work. If someone could help? Please find attached my VI. Best wishes to all visitors to the Forums of Discussion OR.

    Ihab El-Sayed

    published here: http://forums.ni.com/t5/LabVIEW/Playing-sound-based-on-exceeding-a-threshold-value-1D-array-data/m-p...

  • consecutive measurements or 6221 with good timing

    OR PCI-6221 allows us to measure some transient phenomena. Our wish is to change the sampling frequency, while measurement is in progress and keep the time stamp on the right. For example, we measure for the first ten seconds with 100kS/s, for the next 90 with 1000kS/s and for the next 900 with 10 s/s.

    Is it possible to use the internal clock to do this? If yes how?

    Dear Kypros

    Technically, you can implement a solution to this request by creating a train of pulses from a meter out. You can change the frequency of this output of cunter on the fly and correlate your acquisition of this counter. Feel free to look at the examples in our developer zone. You can find this useful example:

    http://decibel.NI.com/content/docs/doc-11762

  • Pavilion 17-F001dx: 'Windows 8 using 100% of the HARD drives with high average response time and low write speed '.

    It turns out that it is a pretty known issue windows 8.1 users infestation since at least 2013 and there is not a simple fix, then it cannot be * completely * lack of hp. but I've had two of these laptops, both the same model, one needing to be returned and exchanged for a problem absolutely no report with (hardware failure: ethernet port does not work with lights taped). Both are renovated. Both have been extreemly slow and unresponsive even compared to the lower Brazos powered by the laptop that I had before, but I recently decided to investigate why.

    So if there is something specific HP going on here, I hope that there is a simple fix. My average response time went upward as well more than a minute (> 60, 000ms), so that I'm an aberrant case here against this problem of reactivity/band bandwidth hardrive typical windows 8.1.

    Edit: there is a case with another HP pavilion laptop (intel powered, so there may be a problem of storage driver intel described in the first link) being much worse.

    Did not want to resort to that, but,.
    Going to a new facility to clean up an image of Windows Pro 8.1 from DreamSpark for my school.

    Disappointed by the lack of response. Given the odd subdomain name (h30434), I'm wondering if this forum has been abandoned.

  • with an average

    Hello everyone,

    I have a question about signal average in labview. Please help me.

    I have two entries of signals to my LabView code, one comes from a function generator (in saw teeth with a frequency of 10 Hz and amplitude of the 0.4V) and the other by a detector. For each voltage coming from the unit, there is a response of the detector so that I can have a graphic on my code that the vertical axis is the response of the detector and horizontal axes is the voltage of the generator (the graph is original linear signal from).

    The frequency of the generator is of 10 Hz and I have 10 signals per second (as time passes, a lot of signals can be seen on the other). Now, how can I know LabView that update the chart every 5 seconds, what was on average 50 signals? In fact, I need to see only the final signal that is an average of 50 raw signals.

    Your help will be really appreciated

    Thank you

    Soran

    Hi Soran,

    I think the problem is that when the time is up, you stop the program and draw the thing on the XY graph. Problem is that when you stop code, the graphic delete (of course there that shift registers not initialized that contains the value of your past last run results). The easiest way is to use queues via the architecture of producers consumers (http://www.ni.com/white-paper/3023/en/).

    From the diagram below, you can see that I have 2 while loops. One is the producer where I store the values of the DAQ assistant in a queue while the lower loop is my consumer which I extracted the data stored in the queue. So for every 100 ms time will send the True value to the business structure that stores the value of the queue (you will need to play with the settings of the DAQ Assistant). If this is not the case, the producer while the loop runs the false cases indicated in the second screenshot. The consumer while loop, there is a queue Status.vi get that checks the State of the queues. As soon as there are 10 items in the queue, I find their (real case turns structure) which gives you an array of 10 elements. I have summarized the table of 10 elements and divide them by their size of table (10) and he draw a waveform graph. Otherwise, the consumer while loop runs the wrong case (meaning no evidence is found and allow the data to be buffered).

    Just take screenshots above regarding your own reference. I'll leave the rest to you on how you want to adapt this concept in your code.

    Hope that helps

    Warm greetings,

    Lennard.C

  • with an average of streaming data

    I take analog measurements on a module SCXI 1102C through a PXI for LV2009. I'm running the DaqMx Read 1 d Waveform to 100 samples per second in a while loop that runs every 45-50 MS, it means that I get about 5 data points per while the loop iteration. Even if the program is windows-based, it has a good amount of determinism built in. I now have to make a decision based on an average of 15 samples, preferably 25-50.

    I can't slow down the while loop down because there are other channels in data that must trigger some things at the fastest rate possible in windows. I can live with the latency of 50 to 100 ms for the latter, but not the 500 ms I would get if I slowed the loop down to this new task.

    Are the only two options that I came to use five registers with shift on the while loop, but I really don't like this idea. Or open the TDMS file while I write these data and read the seconde.25 block that I need a way to make a decision. Also seems to be a bad idea.

    A third option, in my opinion, would be to place a Subvi who writes this string to five different functional space and constantly updates their creation of a buffer running. It seems not a bad idea, I just don't know how to implement it yet.

    Any option obviously better that I'm missing?

    There are two different methods that can be used. If the loop of writing runs more slowly that the loop of the acquisition, then the functional global is to keep a number of samples in it anyway. This allows more data work on when an average.

    The other is to use a moving average. I have attached a VI that does this. It's a global functional on its own.

    Rob

  • waveform, with an average of results using labview to O-scope

    Hello fellow engineers! I'm a first-yeargraduatestudent in CHEE at the University of Houston. Basically, I know nothing about labview. I am trying to program an application that looks like this - I collect a waveform of the signal of O-scope. This waveform does not change its characteristic shape. I need to find the wave form average of waveforms of N (100 for example). Thus, the slight changes (or noise) in the feature of form during the period mustbeaveraged out and I need to have a resultant waveform that represents the average waveform over a period. So, basically, I'm collecting the wave several times (for example 100) on a single period. The O-scope that I use now is Tektronix TDS 2024 B. It communicates with the computer via USB. The version of labview is 8.5. For now, I am able to communicate with the computer using our o-scope through labview. I already downloaded the driver of instruments of your Web site. It turns out that the program can give me only the average result I can get directly from o-scope manually. I need to have more say on average (100) using labview. I wrote a program that relies on the instrument driver that is downloaded on your website (for loop part is average, the waveform). The program that I modified and an instrument driver are attached. The program cannot be fully open, if the driver is not put in the right place in the labview (under lib inst.) When I run the program, the average waveform does not appear on the front panal and signal waveform file is not saved correctly. Is there someone can find where I did wrong and it develop for me? Because I barely know Labview, it will be even better if you can add an image or program that you have changed. I'm waiting for your creative ideas.
     
    With the best regards,.
    --
    Weiye


  • With an average of 10 channels of waveform separately

    I've written a VI that takes input from 10 different devices then shows in several graphics and then saves in PDM. This works perfectly well. The problem is, on my PDM data, is saving 25 samples per second creating a file of long worksheet for short durations. Im trying to figure out how to reach an average of each channel independently (average 25 samples) and print it out every second, so there should be a 1:1 ratio between my timestamps and data, not 01:25 how it is now. Thank you!

    Personally, I just averaged 100 samples you take.  If this simple solution is to replace your table decimate (inside the square structure) with a Mean.vi.  You will need to use a range of build with a single input to transform a table to write in the waveform (still inside in Place element Structure) of the average.

  • Table 1 d with rejection of the two consecutive points

    Hello

    I have table 1 d with 10 measuring points. I treat points in pairs and according to the difference between two consecutive points, I have decision weather the two points must remain in the table or should be rejected. For example, my 1 d table looks like this: 10, 20, 30, 35, 40, 44, 50, 51, 60, 69. I calculate the difference between consecutive points by pairs: 20-10 = 10, 35-30 = 5, 44-40 = 4, 51-50 = 1, 69-60 = 9. I would like to reject the table points with the value of the gap less than 2. In my case, the points are 50, 51 and the table after the rejection should have 8 items and look like this: 10, 20, 30, 35, 40, 44, 60, 69. What is the most elegant way to do it? I'm in LabVIEW 8.6.

    Thanks in advance!

    Review your original message and your example to better understand your stated requirements.

    "I treat the couple points."

    You have to take into account only the pair of 1st and 2nd point, then don't take into account the point of 3rd and 4th pair so on and so forth.

    Never consider the 2nd to 3rd or her never consider the 4th to the 5th, so on and so forth?

    What is your table? If it is very large (1000000 points), you may need to consider other options for the use of memory and speed.

Maybe you are looking for

  • Fill in the empty fields

    Hello! everyone I'm looking for a finder keyboard shortcuts. Please fill in some blanks. again smart folder (...) (b) original alias file (...) (c) empty the trash without asking (...) (d) hide the Search tab (...) (e) add section selected finder to

  • How to refresh the page

    I usually go to view, refresh, however, discounting is not an option since I use firefox. where to cool off?

  • FireFox will never produce its own webmail program?

    Just ask the question if we can expect Firefox to have its own webmail.

  • message unread iOS 9.3.1 electronics showing

    Hello community, I just upgraded to ios 9.3.1 and my Inbox shows 1 unread message. However, there are none. I deleted everything in the Inbox, but of course, it shows still 1 unread message. So I disabled my account, rebooted and turned back on. Show

  • HP pavilion slimline s530f has IE8

    installed in the browser 'by default'?  I know that there Windows 7...