LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Performance issues for setting colors on tables

I have a large table, over 1000 lines where I need to set cell background colors. I have found that the performance really drags when setting many cells such as 1/3 of the cells. Is there a preferred method for setting cell colors which does not degrade performance too much? Currently I set the active cell then the color. I know that performance is enhanced when using a row or column designation of -2, but I cannot always do this. Thanks.
0 Kudos
Message 1 of 5
(2,490 Views)
First, are you sure you need 1000 lines displayed? How much info can a person take in at one time.

If it is needed, then try setting the 'Defer Panel Updates' invoke node to True before you change anything in the table, then back to False after. This will let LabVIEW do all the front panel updates after everything is set. It should help.



Ed

Message Edited by Ed Dickens on 04-20-2005 08:17 PM



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 5
(2,486 Views)
Hi Ed,

I only display a few lines at a time. It actually takes a loooong time to to write the bg color to cells even if the cells are hidden. I have already tried deferred updates but it doesn't improve performance at all. Attached is a test vi which I put together. I create a table 1023 rows by 25 columns. During execution I defer updates, fill the table and color one column, one cell at a time. I also have a timer to benchmark the operation. It is easy to try this with and without deferred updates. If the table is scrolled to row 0 the operation takes about 400 msec. If the table is scrolled to the bottom, row 1022 then the operation takes almost 12 SECONDS. Same table, different scroll position. Any insights on this? Is there a better way to do this? This is being used to show up to 1024 channels of controls. The colors are being used to show what controls have changed state and need to be downloaded to the hardware. Thousands of cells can change state so I am investigating the colored cell approach. I have seen the same performance issues with foreground cell color. Any suggestions would be great...thanks.
0 Kudos
Message 3 of 5
(2,468 Views)
I have no idea why it does that. I'm thinking BUG!!!

I do see the same you are saying. I also noticed that the time slowly gets longer as you scroll through the table in both directions. Displaying somewhere in the middle of the table take half as long as showing the end.

I did find a fix though.

After you turn on defer panel updates, get the current displayed index value for the table and store it in a register, then set it to 0,0. The user will not see this since the panel won't update. Then after your background color code runs, reset the table index to what it was and turn on panel updates.

Doing this gives equal runtimes no matter what the table is showing.

Ed

Message Edited by Ed Dickens on 04-21-2005 10:06 AM



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 4 of 5
(2,462 Views)
Hi Ed,

Playing with the index value is a good suggestion. I tried that before and got the same result as you. Its a reasonable work around to keep the update time to a minimum. Thanks for your help.
0 Kudos
Message 5 of 5
(2,451 Views)