LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using SetTableCellVal() in LW/CVI to display about 20000 lines of data. But the speed is very slow,how can I improve it?

Hello,
Are you refreshing the panel everytime you call SetTableCellVal()? If so, that would definitely slow down your program. If you want to speed up the process, make sure you do not call ProcessSystemEvents() anywhere while you are setting all the values. You can also play with CVI Sleep Policy (Options->Environment in the project window) to see if it can speed up the process. Any way, adding 20000 values still should take a long time; it is a lot of data!
0 Kudos
Message 2 of 9
(8,505 Views)
Hello, I had the same problem and...

There are two ways to solve it:
The first is to use SetTableCellAttribute(panel,
CONTOL,cell,ATTR_CELL_VALUE, value ) instead of SetTableCellVal(): is
VERY faster!

The second is to disable the table (with visible attribute)
SetCtrlAttribute (panel, CONTOL, ATTR_VISIBLE, 0);
then you use 20000 or more SetTableCellVal() and then
SetCtrlAttribute (panel, CONTROL, ATTR_VISIBLE, 1);
re-enable the control visibility attr. Doing that in a single callback,
the control NOT disappear until you call ProcessSystemEvents, so the
result is a simple very fast update of your table.

Hoping that will help,
Ciao
Raffaele


Tim Robinson wrote:
> Using SetTableCellVal() in LW/CVI to display about 20000 lines of
> data. But the speed is v
ery slow,how can I improve it?
>
> Thanks
0 Kudos
Message 3 of 9
(8,505 Views)
Try temporarily hiding the table while you're updating it e.g.

SetCtrlAttribute (panelTop, PANEL_TOP_TABLE, ATTR_VISIBLE, 0);
Table commands ...
SetCtrlAttribute (panelTop, PANEL_TOP_TABLE, ATTR_VISIBLE, 1);

"Tim Robinson" wrote in message
news:506500000008000000EB7C0000-1042324653000@exchange.ni.com...
> Using SetTableCellVal() in LW/CVI to display about 20000 lines of
> data. But the speed is very slow,how can I improve it?
>
> Thanks
0 Kudos
Message 4 of 9
(8,505 Views)
thank you , I think it works.
0 Kudos
Message 5 of 9
(8,505 Views)
Also, whenever you're setting the values of multiple cells, you should be using SetTableCellRangeVals, which is much more efficient than calling SetTableCellVal multiple times.

- luis
0 Kudos
Message 6 of 9
(8,505 Views)
I have just try the second ,the speed is improved,but still very slow.(I try displaying a 2000 cells int array). I still can't understand why the speed is so slow.
0 Kudos
Message 7 of 9
(8,505 Views)
Hello Mr.Gomes,you means I shall format the datas into an array,then use SetTableCellRangeVals to display it?
I havn't try this function.I don't know why it takes so long time for LW/CVI to display the datas in table use SetTableCellVal.
0 Kudos
Message 8 of 9
(8,505 Views)
Yes, that is what I meant.

The reason it takes long is because when you use SetTableCellVal. the function has to redraw the entire table (well... its visible portion) after each value that you set. However, you probably only need to draw it once, after setting a series of values, so you could save a lot of time by using the array function instead.

- luis
0 Kudos
Message 9 of 9
(8,505 Views)