From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Relative time on waveform chart

Hi,

 

How do I set a waveform chart with relative time.. from 6am to 6pm? I set the minimum and maximum (by.. right click- properties settings) to 21600 and 64800. I set the offset value to 21600. But when I run, there is no synchronization. If I run the vi at say 10am, shouldn't the y value be at 10am point on the chart? or is it that I have to run at 6am itself?

0 Kudos
Message 1 of 19
(4,025 Views)

What data are you sending to the chart?  Is it a waveform, scalars, or an array?  If it is a waveform, make sure the t0 is set appropriately in it.  If it is scalars or arrays, make sure the scale factors for the X axis, multiplier and offset, are set correctly.

0 Kudos
Message 2 of 19
(4,010 Views)
And did you set the x axis property for relative time?
0 Kudos
Message 3 of 19
(4,007 Views)

Hi ,

 

I am sending scalars to the chart. Yes, I have set x- axis offset and multiplier. Offset is 21600 and multiplier is 0.5 (By the way multiplier is the interval between samples ryt?)

@Dennis  Yes, I have set x axis property for relative time.

0 Kudos
Message 4 of 19
(3,997 Views)

No.  Offset is the time that your first data point occurred.

 

You want to set the X min of your X-scale to be 21600 seconds, but the offset of the data should be the time in seconds that it occurred.  Setting the offset to 21600 is why your first datapoint is showing up at 6 am rather 10 am.

 

Multiplier is the scaling of the data.  So if you are getting 2 readings per second, then your multiplier would be 0.5.  If you are getting a reading every 5 seconds, then your multiplier is 5.

0 Kudos
Message 5 of 19
(3,988 Views)

Hi Raven,

 

So you mean I should hit run at 6am? Can I programmatically set the vi to run at 6am? .. and what happens after 6pm? Will the results not be displayed on the chart?

0 Kudos
Message 6 of 19
(3,968 Views)

Hi kdm,

 

if you want to have x axis as time you should use graphs. They will make your life easier in the end…

 

Either use waveforms (instead of scalars), they come with timestamp data embedded. Or use an XY graph and provide a timestamp for each sample.

 

Charts may work, but you will have a lot of extra effort:

- Charts have a fixed history. You need to provide a history size so all your data between 6AM and 6PM can be buffered internally.

- Charts support only fixed sample rates (when used with scalars). When you don't provide samples with a fixed samplerate you will not show correct plots…

- Using scalars you cannot plot Y vs X value. The chart will always use the index number of the point to calculate it's x value…

 

Advantages of graphs:

- They support real timestamps for x axis.

- The buffer is only limited by your programming.

- They offer more capabilities regarding x axis manipulation.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 19
(3,964 Views)

Hi Gerd,

 

Thanks for the information. I will experiment with XY graphs.

 

How do I programmatically start the VI at 6am and stop at 6pm? And what do you mean by "The buffer is only limited by your programming." Is it possible to make it run for months? Don't I have to set the buffer length?

0 Kudos
Message 8 of 19
(3,958 Views)

Hi kdm,

 

Is it possible to make it run for months?

I wouldn't trust on a Windows PC for month, but in general: yes.

 

And what do you mean by "The buffer is only limited by your programming."

I mean: The buffer can be as big as you program it to be…

 

Don't I have to set the buffer length?

Sure, but it's up to you. And you can change it at runtime (in contrast to using a chart with a fixed buffer size)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 19
(3,949 Views)

Hi,

 

If I have set my relative time as 6am to 6pm, and I refresh chart/graph at 6pm, the maximum(x scale ) changes and data still keeps plotting even though it is not 6am yet.. Why? 

0 Kudos
Message 10 of 19
(3,892 Views)