I am sampling analog inputs. I simply want to display the max and min values with the time they occurred. This seems simple but I am new to LabView and can't find a Vi to do this.
On the Waveform>Waveform Operations palette is the function Waveform Min Max. It returns the Y min and max values and the times that they occurred. If all you have is a Y array of samples, it's easy to create a Waveform data type with the Build Waveform function on the Waveform palette. Just input your Y array, t0, and dt (inverse of you sample rate).
If I simply have a for loop that creates an array of say 100 points. I have this nested in a while loop set for 5 sec. What values to I put in for T0 and dt? How do I get the time to display the computer time/date? Sorry this is all new to me.
Search the examples for Real-Time Chart.vi and give that a look. The delay provide by Wait Unitl Next ms Multiple (or just a simple Wait (ms) function) is the dt. You can use the current time as in the example to provide the t0 or just a value of 0 if all you care about is the relative time between the two cursors.
If I understand your question, you are wanting to sample a signal that is varying over time and each time it hits a new min or max value, you want to plot that new value and the time it occurred. If this is correct I can send you a VI to do that...
Mike...
Certified Professional Instructor Certified LabVIEW Architect LabVIEW Champion
Yes! What I am doing is monitoring slowly changing analog signals in a while loop. (Meterogical sensors like temperature and humidity) and displaying them. I need to know when these sensors reach thier max/min levels. I am new to labview and I am slowly building up my Vi. Thanks!
Here's the code. When you run the demo program, you'll see three traces: Green is the max so far, Red is the min so far, and White is the current signal value.
As the input value cycles, you'll see the two limit values track its extremes. If you have any questions about how it works, just holler.
Mike...
Certified Professional Instructor Certified LabVIEW Architect LabVIEW Champion
The next-to-last values in the X-axis arrays coming out of my plotting routine and going to the graph is the time stamp of the latest maximum and minimum value.
Mike...
Certified Professional Instructor Certified LabVIEW Architect LabVIEW Champion
I modified the demo application to show how to isolate the two values you wanted. I also added a button to allow you to reset the min and max value search at anytime.
Mike...
Certified Professional Instructor Certified LabVIEW Architect LabVIEW Champion