Hi LabVIEW Community,
I'm struggling with the proper way to plot a large number of independent lines on 3D.
Please find attached a simple code to reproduce the problem. In this example, the 3D line graph is used to plot a single line described by 6000 points with excellent performance. However, my objective is to plot independent lines without connection between them, so the second 3D line graph is intended to plot the same line with this approach. In this context, 6000 line objects are stored in the graph array in short time (25 ms approx.), but the LabVIEW interface freezes for a few seconds (5 s approx.) when the indicator is fed with the data. The poor performance of the 3D line interface produces an unusable application.
As the same line is rendered for this example, both figures should have similar computational time. I'm wondering if there is some computational overhead when multiple objects are plotted.
How can I tackle this obstacle and achieve the goal?
Thanks to all in advance.
Solved! Go to Solution.
Well, I can't look at your code, but I would expect plotting 6000 lines to take, as a first approximation, 6000 times as long as to plot one line. In the 6000-line case, you provide two points and ask LabVIEW to "connect the (2) dots" 6000 times, giving new end-points each time. In the 1-line-of-6000-points case, you provide the points and ask LabVIEW to plot 6000 points, interpolating between them. Depending on the "inner workings" of the "connect-the-dots" algorithm, the timing should be longer with separate lines (maybe not 6000 times, but certainly longer ...).
Hi Bob, thanks for your reply.
That means that there is no way to plot a large number of independent lines (3D) on LabVIEW? Other platforms seem to be very competitive in this matter.
Do you need a copy of my code on another version? (I have included 2017, 2016, 2015)
Thanks and have a nice afternoon.
I modified your code a little bit (to get better timing accuracy). I didn't realize you were talking about 3D line plots (which are much more complex than 2D graphs). Plotting one line of 6000 points takes about 113 microseconds. Plotting 6000 lines of two side-by-side points takes 24,829 microseconds, roughly 200 times slower, but still pretty darn quick!
Here's my (revised) code as a Snippet (LV 2016). I'm using the High Precision Elapsed Timer ...
I was surprised by the slow refresh of the graph indicator in this case. The "Loop Time" is very short, but the LabVIEW environment is frozen for multiple seconds when it reaches the "3D Graph (6k lines)" indicator.
Thanks for your help and interest.