LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform chart time axis is not matching the waveform data

So here an interesting conundrum I hope you might be able to help me with...
 
My VI has waveform data sent to a chart, though the data is not being plotted against the current time.  Rather, it is being plotted starting way back in the reference time (way back in 1903).  I don't understand why this is happening.  When I build the waveform, I use the "Get Date/Time in Seconds" function outside the while loop and feed that into my "Build Waveform" Function as the t0 value.  My dt value is 0.05 (20 Hz) and then I feed in my array of data in the Y input.  Any ideas why the chart is plotting this data over 100 years ago?  Thanks!
 
Andrew
0 Kudos
Message 1 of 5
(3,883 Views)

Hi Ronin10,

      If you were to attach a picture of your diagram, it would be a huge help.

Cheers.
When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 2 of 5
(3,856 Views)

Hiii, Ronin

      Here is your solution.

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.

Thanks,

Nishant

Message 3 of 5
(3,856 Views)

Nishant!  That was exactly what I was looking for.  Thanks for the help!

ronin10

0 Kudos
Message 4 of 5
(3,824 Views)

Hiii, Ronin

       Glad to help you and i ll be always ready to help if it is possible for me.

Thanks,

Nishant

0 Kudos
Message 5 of 5
(3,814 Views)