LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is plotting points so much slower than plotting lines in Laview graph controls?

Hi Guys,
 
I found that plotting points is very slow compared to plotting lines in Labview graphs control (XY Plot for example). One would assume that the reverse is true. Is there a reason for that? And is there any way we could plot points as fast as we do lines(connected points)?
For your infomation, it takes 15ms for my machine to plot 8000 connected lpoints (i.e.lines), whilst 80ms for non-connected points. I am still using Labview 7.1 for a current project, unless there is a good reason for going ver 8, I would rather keep the same version for safety. But is ver 8 offers speedy point plotting, then that will be a good reason....
 
Thanks.
 
SYS 
0 Kudos
Message 1 of 5
(2,641 Views)

If I understand you correctly, you are commenting on the differnt plot styles.

I suspect the graphs are optimized for lines.

If you re-wrote the graph by hand I suspect the reason for the speed difference would be come obvious. The points are small, filled circles. THe lines on the other hand are implemented as "Line to" commands.

Just guessing!

Ben

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

Hello

This is saha from National Instruments.Thanks for contacting us.

According to your information, I have created a simple VI which just plots 8000 points in a XY-graph and the total time needed is calcuated using Tick Count(ms) function.When I change the plot style from line to pionts (by right clicking the plot legends), the required time does not change and both takes just 3 to 4 ms in my PC.So I think there is something wrong with your program or with your PC.Here I am attaching my VI.

Best of luck

saha| Application Engineer|National Instruments, Japan

 

Message 3 of 5
(2,611 Views)
Thanks for your feedback.
 
I have the vi you sent, and found that they are indeed of very similar speed of 2-3ms for both points or lines.
I do more data points, and they still report the same time difference between two modes. But visually, they do display differently on the screen.
 
I then further changed the vi a little, putting on synchronous screen update option, and add a loop to see the accumulated time for say 10 loops.
What I found is funny that if you run the vi 1 loop, then it gives 30ms, for both lines or points.
But if you run 10 loops (which is my case, as I am writing a real time scope program), then the difference is becomining stunning. Please try it out and see what you think about the problems are...
 
My results here: repeat 10 times -  point mode   10,933ms, line mode    2,866ms
 
I have turned off autoscale and stuffs, but keeping smooth-update on.
 
I have looked into internal code a little, and found that lines mode is using the picture drawing command "draw-multi-line" which push the whole drawing array into the picture code, with some opcode... But point mode is pushing point drawing opcode into the picture code one by one using labview loop. May be that is the difference in speed??? Is there a "draw-multi-points" optcode available?
 
Will appreciate any feedback from you guys! Thanks!
 
 

Message Edited by sys on 02-07-2007 12:37 AM

0 Kudos
Message 4 of 5
(2,607 Views)
Hi sys,
you must uncheck "synchronous display" on your graph, then you get the same fast response time in both modes. Synchronous display means, the graph updates the plot and sends a redraw- event to the user interface thread. Then the graph waits for the UI to finish redrawing and after this your code can continue to execute. If not set to synchronous, the graph just fires the event and returns immediately. So if you update your graph fast enough it is possible, that it is only once redrawn after several updates.
Hope this helps,
Greets Dave
Greets, Dave
0 Kudos
Message 5 of 5
(2,594 Views)