LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Chart based on irregular time

Solved!
Go to solution

Hi, I am continuously acquiring voltage through a compaqdaq. What I want to do is graph that voltage (Y) versus time (X). The problem I have is that the time between measures is not constant, so I cannot set a constant rate time to do and XY graph or equivalent. So how can I graph the voltage values with the X being time?

 

Thanks in advance.

0 Kudos
Message 1 of 9
(2,991 Views)

The XY graph is exactly what you need. Points on an XY graph do not need to be regularly spaced because each point consists of an X value and a Y 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 2 of 9
(2,984 Views)

Thanks for replying.

 

On the XY graph you need to have all the values in an array, right? But what if I am updating the values every second and I don't want to have an array of all the values that I have acquire. This will be a gas cycle machine, so it will be acquiring voltage for months without stopping, so it would be a lot of memory to have all those values in an array. Or am I wrong?

 

 

0 Kudos
Message 3 of 9
(2,982 Views)

With an XY graph you only plot the data you want to. If you want to decimate your entire dataset such that there is only one point per day being plotted, that is perfectly fine. In fact I once had a job where we were sampling a DAQ card very rapidly to catch transient events that happened very sporatically. To keep from saving a ton of essentially identical data I created code that only save a new datapoint of its value varied from the last one by more than some set percentage. The result was a plot that showed nothing for days and then 100 or so datapoints covering a 1 second period, before there was another break of hours or daya before another burst of activity.

 

The XY plot handled it fine and kept proper track of the times for each recorded datapoint.

 

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 4 of 9
(2,979 Views)

The thing about an XY graph is that I need to have all the points saved in an array, but what if I just want to add the next point (like a waveform chart) without using an array? Because if I just add the point it overwrites whatever was previously on the graph.

 

Thanks.

0 Kudos
Message 5 of 9
(2,948 Views)

You cannot simply add the next point, only the Waveform Chart can do this, because it infers what the current time since the delta t is constant.

You will need to generate two 1D arrays, with the 1st array being time and the 2nd array being the data point. Then you can cluster the two 1D arrays and pass this cluster to the x-y plot. This way, you can just append the last data point onto each respective array.

Cory K
0 Kudos
Message 6 of 9
(2,943 Views)

You can not do that. However, you can add a bit of code to locally buffer the data so it acts like a chart. There is an example that ships with LV called XY chart that demonstrates that very thing.

 

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 7 of 9
(2,935 Views)
Solution
Accepted by topic author rugebiker

You could always pass a waveform (with a single point) to the chart and it will display irregular points.  Use Build Waveform with t0 set to the current time and Y set to an array of one point (the current value).  That said, I typically do not like charts and roll my own with the XY graph like the others around here.

Message 8 of 9
(2,926 Views)

 


You could always pass a waveform (with a single point) to the chart and it will display irregular points.  Use Build Waveform with t0 set to the current time and Y set to an array of one point (the current value).  That said, I typically do not like charts and roll my own with the XY graph like the others around here.


 

I tried that and it worked!: build waveform and attach to Y the samples in a one element array, and on t0 the actual time. Thank you very much. I'll also try to do it with the XY graph.

Thank you.

 

0 Kudos
Message 9 of 9
(2,918 Views)