LabWindows™/CVI™ Graph Control Drawing Is Too Slow

Updated Mar 27, 2023

Reported In

Software

  • LabWindows/CVI

Issue Details

I used LabWindows/CVI to write a data acquisition program and put the collected data on the waveform graph through some drawing functions (PlotXY, PlotX, PlotY, or PlotLine). When drawing a curve continuously on a waveform, the speed of drawing will become slower and slower with time. What should I do?

Solution

This is determined by the way of drawing function execute in LabWindows/CVI. When a waveform drawing function is called, LabWindows/CVI will create a copy of the data. Each time you add a curve to a waveform, LabWindows/CVI redraws all the curves in the waveform. As the number of curves displayed in the waveform graph increases, the program runs slower and slower. 
In order to improve the efficiency of the program.
  1. Double-click the graph control in the .uir file to open the control editor
  2. Remove the checkmarks in front of the Smooth Update and Copy Original Plot Data selection boxes. 
  3. Changing the Data Mode from Retain to Discard will also improve performance. 
But you may not see the curve you previously painted on the waveform (drag the user interface to the display region outside when running, and can't see the curve after drag back). 
The quickest way to draw graphics is to use the Canvas control instead of the graph control. The canvas control is an area where you can draw arbitrary graphics and can be used to display lines, points, text, waveforms, and bitmap files. When using the canvas control, LabWindows/CVI saves the graphic to a bitmap outside the interface, allowing the user to add the waveform directly. However, the canvas control does not distinguish between the different graphics parts displayed on it. So if you want to use a cursor or access a single curve, the waveform diagram may provide a better solution.

Additional Information