10-03-2017 02:25 PM
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.
10-03-2017 03:41 PM
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 ...).
Bob Schor
10-04-2017 11:46 AM
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.
10-05-2017 03:43 PM
Oops, didn't see the multiple versions -- I'll look at the 2016 one.
BS
10-05-2017 04:56 PM
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 ...
Bob Schor
10-06-2017 04:33 AM
Try inserting NaN between lines X0,X1,NaN,X2,X3, ... Y0,Y1,NaN,Y2,Y3,... Z0,Z1,NaN,Z2,Z3,...
This creates 9000 points, but is still faster then 6000 plots...
For me:
Points: 0.14ms
Line plots: 34ms
Line with NaN 3.9ms
10-09-2017 07:44 AM
Hi Bob,
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.
10-09-2017 07:48 AM
Many thanks Wiebe! Your approach seems to be working with excellent performance.