LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV 2011 - Displaying multiple plots on a waveform graph, with accurate time as the X axis.


@arteitle wrote:

Are there advantages to feeding an array of one-point waveforms to a Waveform Chart compared to feeding an array of points to an XY Graph? It seems largely equivalent.


I agree to a large extent

 

The one difference that does come to mind is not in the plotting but in that plot legend.

 

You set the waveform attribute "NI_ChannelName" for a waveform and provided "ignore Atributes" is NOT selected, the plot legend will automatically adapt.

 

The other difference that comes to mind is the graph will not ache the history so we have to work little more to display a continually updating plot and keep building up an array to do the updates. The WF Chart will let you through updates at it as they come in and using "one-point" waveforms and using the T0 of the WF, we can plot data that is not coming in at a constant rate.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 11 of 14
(494 Views)

For this application it's really about complexity and loop runtime. This is a safety interlock program that needs to be rock solid, and more complexity means more failure points. It's very difficult to test as well since it relies on hardware interfaces that can't be simulated. 

 

And of course it's all running on old hardware. Passing a point to a waveform chart is much simpler than passing two arrays to an XY chart, redrawing the chart entire, and managing the arrays in the meantime. 

 

Using a waveform chart is also faster because I don't have to do those array operations before the chart is made. Right now the main loop runs about 680 ms, which is partially gated by DAQ hardware and partially just because I'm doing all this stuff like writing to plots. I have split off as much functionality as possible into a parallel loop but it can't all be there. 

 

I'm no computer scientist, and it's likely there's no reason for me to shy away from just running complex operations in a parallel loop, but my feeling is that for absolute program stability I want to minimize the complexity of the VI as much as possible.

0 Kudos
Message 12 of 14
(490 Views)

Interesting, you can give the Waveform Chart one point at a time, where the point is a waveform with arbitrary t0 and a single Y value, and it'll act like an XY Chart. It looks like the points do have to be supplied in order of increasing time; if you try to go backwards it clears the plot before plotting it. I had no idea this was possible, thanks!

Message 13 of 14
(486 Views)

@arteitle wrote:

Interesting, you can give the Waveform Chart one point at a time, where the point is a waveform with arbitrary t0 and a single Y value, and it'll act like an XY Chart. It looks like the points do have to be supplied in order of increasing time; if you try to go backwards it clears the plot before plotting it. I had no idea this was possible, thanks!


True.

 

keep that in mind when computing your own timestamps, "Y-arrays", with a dt for the Y-array sample spacing. If the last data point plotted is latter than the T0 of a new update, you will see the same effect.

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 14 of 14
(482 Views)