LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I display the Time&Date of the Max and Min values from a waveform chart?

Hi there,

This should probably be a fairly straight forward problem to solve!! Basically I have a waveform chart plotting Power vs Time, and I display the Maximum and Minimum Power as I vary the load resistance in an external circuit, connected to LabVIEW via a LabJack U12 interface card.

I have a "Waveform Min Max.vi" function that obtains the Min and Max values of the power and displays them on two indicators. Connected to this function are a further two indicators for the Min and Max Time. However when I run the program the Time & Date start from 01:00:00 on the 01\01\1904. What I require is the correct Date & Time to be shown for the corresponding Max and Min Powers.

P
lease find attached my vi file.

I would be very grateful for any ideas on the matter,

Best Regards,

Neil Sampson.
0 Kudos
Message 1 of 6
(3,801 Views)
The Waveform Min Max function will correctly return min and max time if you input a waveform data type but not just a y array. The y array has no time information. You can easily create a waveform data type by using the Build Waveform function and provide the start time and delta time - these would be the same values that you use to set the chart.
0 Kudos
Message 2 of 6
(3,801 Views)
Hi again Dennis,

I have placed the "Build Waveform function" into my program, but still have slight problems with the times that the Maximum and Minimum Powers occur. The time & date appear in the corresponding indicators, but do not remain at the time at which either the Maximum or Minimum values of Power occur.

I have two inputs to the "Build Waveform function", namely, "Get Date/Time in seconds function" connected to the "trigger time of the waveform (t0)" and the output of a "Build Array function" connected to the "Waveform component (Y)". The "Build Waveform function" is in turn connected to the "Waveform Min Max.vi".

I would be grateful if you could shed any light on this matter. Also included is the code.

Thanks again,

Nei
l Sampson.
0 Kudos
Message 3 of 6
(3,801 Views)
You're using a different start time. The waveform start time should be the same value that you use for the chart but each time your while loop iterates, you get a new start time for the waveform. You could move the chart initialization to outside the while loop and just pass the time into the while loop or init the waveform outside at the same time you init the chart scale. Frankly, I think moving both things outside would make the program a bit more readable. I assume you're using the Implies function to do the chart init only on the first iteration of the while loop and if that's the case, there are simpler and more obvious ways to do that. If you do move the init out of the shile loop, make sure you wire the error out of the property nod
e to the while loop in order to assure that it gets done before the while loop starts.
0 Kudos
Message 4 of 6
(3,802 Views)
Hi Dennis,

Yeah the method of placing the time function outside of the while loop seems to have solved the problem. Thanks for your much appreciated advice,

Neil.
0 Kudos
Message 5 of 6
(3,801 Views)
I am having the same problem in displaying the waveform. let me first tell you about my vi. I  am running a while loop and in this while loop there is an if that is true when a button is pressed. now when my if button is pressed than my wave form displaying should start. I have an array of data along with an array of time. i used build array function wired the y with my data array and start time with the start time of my time array i.e just a single element at index 0. i assigned 1 to the dt terminal. then i wired the out put of buid array to the waveform vi.now what is happenening is that when the graph is plotted than on X axis which is my time axis it does not display the time correctly for example if my start time is say 28/08/05 15:01:01 the start time on graph plate would be different than this. what should i do to make the start time correct in the wave form.i also have unchecked ignore   time stamp in the properties of waveform graph.would u kindle spare time to shed some light what should i do ?
0 Kudos
Message 6 of 6
(3,668 Views)