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

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

Post by sys » Wed, 07 Feb 2007 22:10:09


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 
 
 
 

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

Post by K.Sah » Thu, 08 Feb 2007 14:10:07

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
 


plotting time.vi:
http://www.yqcomputer.com/

 
 
 

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

Post by sys » Thu, 08 Feb 2007 15:40:12

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


plotting-speed.vi:
http://www.yqcomputer.com/