LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Chart Problem: Time of Day on the X-axis

Hi,

I have a problem using Charts in labview 7.1.

I generate data points at a variable rate (around 1 second) which i want plotted against absolute time (time of day).

I've selected the format of my chart on the x-axis as Absolute Time. However, this doesn't seem to work. I always starts at 8:00PM and doesn't even follow actual time.

How can I program my Chart to plot Value vs Absolute Time?

Thanks

Aleks.


0 Kudos
Message 1 of 3
(3,673 Views)
Hiii, Labuda
 
            Here is the method by which you can convert your x-axis data to Absolute time and here with this i ve attached one vi which gives you an idea about how to do this.
 
By default, waveform charts and graphs display the absolute time at time 0 as 7:00:00 PM, 12/31/1903 on a Windows based system. Property nodes can be used to get the correct absolute time to display on the x-axis of the waveform chart.

First, right click the chart on the front panel and select X Scale >> Formatting. Then set the format to Absolute Time.

Create a property node for the waveform chart by right-clicking on the chart on the block diagram and selecting Create >> Property Node. Expand the property node to display two properties. Select the Format property and the Offset property. The Format property is located under X-Scale >> Format and Precision >> Format, and the Offset property can be found under X-Scale >> Offset and Multiplier >> Offset. Right click on the property node and select Change All to Write.

For the Format property, the context help shows that there are multiple inputs to this property. Wire in a value of 7 to set the format to Time and Date.For the Offset property, first wire the output of the Get Data/Time in Seconds VI to the input of the To Double Precision Float VI. Then wire the output of the To Double Precision Float VI to the Offset property.

In addition, if you know the number of data points plotted to the chart per second, you can set the Multiplier property located under X-Scale >> Offset and Multiplier >> Multiplier. If there are x data points generated per second, wire in a value of 1/x to the Multiplier property. A simple example program "Chart with Timestamp" that demonstrates how to do that is attached.
 
Hope this helps.
 
Thanks,
Nishant
0 Kudos
Message 2 of 3
(3,672 Views)
Thanks Nishant!

I implemented your suggestions, and it finally works.

I still have issues with it though, my data acquisition is not constant in the first few seconds of run time. so my offset becomes inaccurate if my multiplier is fixed.. Is there a way to choose a time window and make sure that the last data point is always coincident with the current time of day. That is, i would like to choose, say, a 90 second time window, but maybe change it throughout run-time. Also, i want to make sure that the last X-axis value (during the sweep) is the actual time of day... because the acquisition is a continuous 4Hz throughout the experiment (except for the beginning)

Thanks again!

Aleks.
0 Kudos
Message 3 of 3
(3,636 Views)