Peak detect and hold in Labview - labview

I've inherited a labview "circuit" that integrates G's to output IPS. The problem is, the output text window (double), at full speed, has numbers scrolling so fast, you can't read them. I only need to see the largest number detected. I'm not too well versed in LabView - Can anyone help me through a function that will display the largest number outputted to the text window for a duration of 1/2 second? I'm basically looking for a peak detect-and-hold function... I'd prefer to work with the double precision value that is constantly updated if possible, rather than the array feeding my integrator. I tried looking through the Functions>signal processing menu, saw one peak detector, but not sure that's the right utility.
Thanks!

Easier to use the Array Max & Min PtByPt.vi, this can be found in the signal processing, point by point menu. Below a VI snippit with how it works.
It will update the maximum value every 10 points. Also attached a waveform chart that shows the values.

Related

Delayed inputs racing game

i have never used game-maker before, but it seemed pretty easy to use for my school project. I want to make a small racing game, but the car has varying degrees of delay in the controls. The project is for exploring latency. so the delay in the controls could be like .05 seconds or .5 seconds, but it has to save the inputs and output in that order. Do you know how i can do this? i don't really know any commands in the language so any help would be greatly appreciated.
Also id like to add a survey sheet at the end that save the data to like an excel file, is this possible with gml?
A common way to simulate latency would be to create one or more ds_queue that you add new inputs in and pull inputs for the current frame from. The queue's initial size will determine the latency in frames.
For data export, the easiest is to produce a CSV/TSV, which is but a text file with comma or tab separators and can be imported into a wide variety of sheet-editing software.

How to read speed of waveform chart generated from labview?

I need to know the speed of waveform chart of labview
the program generate 2 wave form shifted by 90 i need to make program to find the speed of both
Neither waveform is "generated first". Every iteration of the loop will result in a different true/false value being placed onto the chart. On some iterations, the top one will update first; on other iterations, the bottom one will update first.
What you are seeing in the charts is NOT a coherent waveform. It is just a series of values that you have chosen to plot. There's no time data associated with this, just the values and an iteration count. The iteration counter is the clock of this algorithm, so, in that sense, both waveforms are generated at exactly the same rate at exactly the same time. (See below for comments about the Timed Loop.)
I doubt that this answers the question you think you are asking. You seem to want to know some information computed from these series of true/false values, but the terminology that you've used is not meaningful, and I cannot determine what information it is that you actually want.
I said earlier that the only clock for this algorithm is the iteration counter of the loop. You used a Timed Loop with a dt of 1. Are you on Windows? If so, then my statement is correct: The Timed Loop on Windows is only a simulation without any guarantee of timing, so you might as well be using a regular While Loop. If you are on a real-time OS with LabVIEW Real-Time module, then this is generating a point every 1 millisecond, so the speed of the iteration count is tied to the computer's clock, so the speed of both waveforms would be 1 millisecond.

Oxyplot: IsValidPoint on realtime LineSerie

I've been using oxyplot for a month now and I'm pretty happy with what it delivers. I'm getting data from an oscilloscope and, after a fast processing, I'm plotting it in real time to a graph.
However, if I compare my application CPU usage to the one provided by the oscilloscope manufacturer, I'm loading a lot more the CPU. Maybe they're using some gpu-based plotter, but I think I can reduce my CPU usage with some modifications.
I'm capturing 10.000 samples per second and adding it to a LineSeries. I'm not plotting all that data, I'm decimating it to a constant number of points, let's say 80 points for a 20 secs measure, so I have 4 points/sec while totally zoomed out and a bit more detail if I zoom in to a specific range.
With the aid of ReSharper, I've noticed that the application is calling a lot of times (I've 6 different plots) the IsValidPoint method (something like 400.000.000 times), which is taking a lot of time.
I think the problem is that, when I add new points to the series, it checks for every point if it is a valid point, instead of the added values only.
Also, it spends a lot of time in the MeasureText/DrawText method.
My question is: is there a way to override those methods and to adapt it to my needs? I'm adding 10.000 new values each second, but the first ones remain the same, so there's no need for re-validate them. Also, the text shown doesn't change.
Thank you in advance for any advice you can give me. Have a good day!

Algorithm for reducing GPS track data to discard redundant data?

We're building a GIS interface to display GPS track data, e.g. imagine the raw data set from a guy wandering around a neighborhood on a bike for an hour. A set of data like this with perhaps a new point recorded every 5 seconds, will be large and displaying it in a browser or a handheld device will be challenging. Also, displaying every single point is usually not necessary since a user can't visually resolve that much data anyway.
So for performance reasons we are looking for algorithms that are good at 'reducing' data like this so that the number of points being displayed is reduced significantly but in such a way that it doesn't risk data mis-interpretation. For example, if our fictional bike rider stops for a drink, we certainly don't want to draw 100 lat/lon points in a cluster around the 7-Eleven.
We are aware of clustering, which is good for when looking at a bunch of disconnected points, however what we need is something that applies to tracks as described above. Thanks.
A more scientific and perhaps more math heavy solution is to use the Ramer-Douglas-Peucker algorithm to generalize your path. I used it when I studied for my Master of Surveying so it's a proven thing. :-)
Giving your path and the minimum angle you can tolerate in your path, it simplifies the path by reducing the number of points.
Typically the best way of doing that is:
Determine the minimum number of screen pixels you want between GPS points displayed.
Determine the distance represented by each pixel in the current zoom level.
Multiply answer 1 by answer 2 to get the minimum distance between coordinates you want to display.
starting from the first coordinate in the journey path, read each next coordinate until you've reached the required minimum distance from the current point. Repeat.

How to Periodically Updating Labview chart when collecting multi channel data at a high rate

Looking for some help with a Labview data collection program. If I could collect 2ms of data at 8kHz (gives 16 data points) per channel (I am collecting data on 4 analog channels with an National Instruments data acquisition board). The DAQ-MX collection task gives a 1D array of 4 waveforms.
If I don't display the data I can do all my computation time is about 2ms and it is OK if the processing loop lags a little behind the collection loop. Updating the chart in Labview's front panel introduces an unacceptable delay. We don't need to update the display very quickly probably at 5-10Hz would be sufficient. But I don't know how to set this up.
My current Labview VI has three parallel loops
A timed-loop for data collection
A loop for analysis and processing
A low priority loop for caching data to disk as a TDMS file
Data is passed from the collection loop to the other loops using a queue. Labview examples gave me some ideas but I am stuck.
Any suggestions, references, ideas would be appreciated.
Thanks
Azim
Follow Up Question
eaolson suggests that I re-sample the data for display purposes. The data coming from the DAQ-MX read is a one dimensional array of waveforms. So I would need to somehow build or concatenate the waveform data for each channel. And then re-sample the data before updating the front panel chart. I suppose the best approach would be to queue the data and in a display loop dequeue the stack build and re-sample the data based on screen resolution and then update the chart. Would there be any other approach. I will look on
(NI Labview Forum)[http://forums.ni.com/ni/board?board.id=170] for more information as suggetsted by eaolson.
Updates
changed acceptable update rate for graphs to 5-10Hz (thanks Underflow and eaolson)
disk cache loop is a low priority one (thanks eaolson)
Thanks for all the responses.
Your overall architecture description sounds solid, but... getting to 30Hz for any non-trivial graph is going to be challenging. Make sure you really need that rate before trying to make it happen. Optimizing to that level might take some time.
References that should be helpful:
You can defer panel updates. This keeps the front panel from refreshing until you're ready for it to do so, allowing you to buffer data in the background, and only draw it occasionally.
You should know about (a)synchronous display. This option allows some control over display rates.
There is some general advice available about speeding execution.
There is a (somewhat dated) report on execution speed on the LAVA forums. Googling around the LAVA forums is a great idea if you need to optimize your speed.
Television updates at about 30 Hz. Any more than that is faster than the human eye can see. 30 Hz should be at the maximum update rate you should consider for a display, not the starting point. Consider an update rate of 5-10 Hz.
LabVIEW charts append the most recent data to the historical data they store and display all the data at once. At 8 kHz, you're acquiring at least 8000 data points per channel per second. That means the array backing that graph has to continuously be resized to hold the new data. Also, even if your graph is 1000 pixels across, that means you're displaying 8 data points per screen pixel. There's not usually any reason to display any more than one data point per pixel. If you really need fast update rates, plot less data. Create an array to hold the historical data and plot only every Nth data point, where N is chosen so you're plotting, say, only a few hundred points.
Remember that your loops can run at different rates. It may be satisfactory to run the write-to-disk loop at a much lower frequency than the data collection rate, maybe every couple of seconds.
Avoid property nodes if you can. They run in the UI thread, which is slower than most other execution.
Other than that, it's really hard to offer a lot of substantial advice without seeing code or more specifics. Consider also asking your question at the NI LabVIEW forums. There are a lot of helpful people there.