LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY chart with realtime data

Title says what I want. Resisting complaining. I want an input (Y-axis) with the time that data point was taken on the x-axis. 

 

I have tried every solution posted online and have come up with nothing. Either the time stamp increases at the incorrect rate, or the data/time doesn't post until after I stop the program. I have posted my program below but it is a nightmare trying every suggestion and graph labview has to offer. I have tried xy graph, xy graph xpress, waveform charts and graphs. I have tried creating property nodes on waveforms, and making simple XY graphs. 

 

I just want a value of double associated with a timestamp, and plotted in real time. Thank you. 

 

All graph attempts are on the right side of the block diagram. 

0 Kudos
Message 1 of 8
(4,481 Views)

I may have figured out how to add the time data, but the charts and graphs ALWAYS autoscale from 1998 to 2028. 

 

I have get date/time => dbl => bundle with data. That is then converted to 1D array. I can't figure this out. Thank you. 

0 Kudos
Message 2 of 8
(4,473 Views)
Can you attach an image of the block diagram? I'm posting by phone.

This is usually a pretty trivial task.
0 Kudos
Message 3 of 8
(4,468 Views)

This is the best capture I could get. The problem is that when I "Get time stamp" the graphs always want to set that to t0. Therefore the x-axis always resets itself every time the while loop repeats. Thank you. 

0 Kudos
Message 4 of 8
(4,462 Views)
The graphs are doing what you programmed to do and your programming is wrong.

Let's take the simplest and only complete example you have - the chart with the loop. Outside the loop, set the chart's offset to the current time. Set the multiplier to the wait value (in seconds). Inside the loop, wire a random number function directly to a chart. Wiring a value from outside its just plain wrong. On the front panel, change the property of the x scale to absolute time.
0 Kudos
Message 5 of 8
(4,449 Views)

It seems that there is HIGH demand for an XY graph to behave like an XY chart, but so far labview has failed to provide since ~2007 the latest I have found. I had to use a giant shift register to save my values, build them into an array, and then REPLOT every single iteration. This seems incredibly inefficient, but until they make an XY chart I guess this will have to do. Posted. 

0 Kudos
Message 6 of 8
(4,433 Views)
The express xy graph will operate as a chart. That's been around for quite a while. There was an example called xy chart but it may have been removed.
0 Kudos
Message 7 of 8
(4,429 Views)

@stevenette wrote:

I had to use a giant shift register to save my values, build them into an array, and then REPLOT every single iteration. This seems incredibly inefficient, but until they make an XY chart I guess this will have to do.


Well whether you maintain the shift-register, or LV does behind the scenes, that's the way charts work -- at least with the default update method. And I suppose that a case could be made for the argument that is you are needing to plot so much data that performance is an issue, you are perhaps plotting too much data. Think about it for a minute, if your graph is say 500 pixels wide, you are only going to see 500 distinct X values -- no matter how many you send to it. Better to decimate the data before you plot it -- which also leaves the door open for some really neat zoom effects.

 

But however you handle it, one thing that can cause performance issues is how you are managing the arrays.

 

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 8 of 8
(4,412 Views)