LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CanvasStartBatchDraw in real time is too slow. How do I draw points to the display faster than CanvasDraw and CanvasStartBatchDraw can.

I am reading data in real time over an RS485 link which I then have to parse out, scale to the size of the display area, and paint the display. One block of data read in corresponds to one line painted on the display. It takes approximately 6 milliseconds to paint 500 pixels across the display area. This is entirely too long for my application. Is there faster way to write to the display. For instance, like writing directly to the display memory. How would I do this in CVI? Any ideas out there?

Thanks for any help!

//This is way too slow!
CanvasStartBatchDraw (* pnl, PANEL_CANVAS);
for ( i= 0; i < displayWidth; i++)
{
SetCtrlAttribute (* pnl, PANEL_CANVAS, ATTR_PEN_COLOR, color[i]);
CanvasDrawPoint (* pnl, PANEL_CANVAS, ptPt1[i]);
}

CanvasEndBatchDraw (* pnl, PANEL_CANVAS);
0 Kudos
Message 1 of 2
(2,769 Views)
Hello waltdaschmalt,

The CanvasBatchDraw functions are the fastest way to display pixels on the CVI canvas. After timing the functions with code similar to yours, I got right around 6 milliseconds to iterate 500 times through a loop, change the pen colors and index into two arrays. There is no way to write directly to the display memory, as suggested in your previous post. You could try increasing the priority of your CVI application to Do Not Sleep / Sleep Some from the Options >> Environment window, or programmatically with the SetSleepPolicy() function. This may help reduce the execution time.

Hope that helps.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 2 of 2
(2,754 Views)