LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying Max/Min values with time for analog signals.

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.
0 Kudos
Message 1 of 13
(5,339 Views)
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).
Message 2 of 13
(5,339 Views)
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.
0 Kudos
Message 3 of 13
(5,339 Views)
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.
0 Kudos
Message 4 of 13
(5,339 Views)
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

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 5 of 13
(5,339 Views)
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!
0 Kudos
Message 6 of 13
(5,339 Views)
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

"... after all, He's not a tame lion..."

For help with grief and grieving.
Download All
0 Kudos
Message 7 of 13
(5,339 Views)
Thanks for your help....Do you know how I can display the time/date that the max/min occurred?
0 Kudos
Message 8 of 13
(5,339 Views)
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

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 9 of 13
(5,339 Views)
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

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 10 of 13
(5,154 Views)