jkittle Posted November 27, 2012 Report Share Posted November 27, 2012 I have a table showing data and I change the background color based on user input limits. This is easily done in Excel. In LabVIEW I am looping through the table data (2-D) and setting the 'ActiveCell' and setting the 'CellBGColor'. This is brutally slow. Is there a faster way? Quote Link to comment
Darin Posted November 27, 2012 Report Share Posted November 27, 2012 (edited) You should try deferring front panel updates. You need to clear errors or leave the error in terminal unwired when it comes time to stop deferring the update, otherwise in case of an error you will end up deferring indefinitely. Shameless plug alert: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Make-Defer-Updates-an-Object-Property-as-well-as-a-Panel/idi-p/1292100 Edited November 27, 2012 by Darin Quote Link to comment
hooovahh Posted November 28, 2012 Report Share Posted November 28, 2012 I agree to use defer front panel updates, but if you are dealing with coloring alot of cells (more than say 40) I would recommend trying to do something like this which uses a "Virtual MultiColumn Listbox" This technique only shows a few rows of data, and the rest is shown as the scrollbar changes. This is a good candidate for an XControl. 1 Quote Link to comment
mje Posted November 28, 2012 Report Share Posted November 28, 2012 Both the replies above are definitely true and recommended if you're seeing slow updates. Unfortunately though, even observing these practices can lead to updates which are still unacceptably slow. If you have decent sized data sets consider maintaining the list virtually and only displaying the subset of data that's needed. If you search the forum for a thread named Virtual Multicolumn Listbox (or something similar) you ought to be able to find a post I made a while ago demonstrating as much. Hah, Hooovahh beat me to it. Quote Link to comment
hooovahh Posted November 28, 2012 Report Share Posted November 28, 2012 Hah, Hooovahh beat me to it. I really do love that technique by the way, and I've been trying to combine your stuff with this: I have made alot of progress, but it seems like XControls are never done. I really should post what I've come up with so someone else can have a go at it. Quote Link to comment
MartinPeeker Posted November 28, 2012 Report Share Posted November 28, 2012 A somewhat more simple approach to this actual case: The OP is setting the colours of all cells to one of two different colours to highlight failures. More efficient would be letting the default BG colour be white and just update the yellow cells (bool is false) in a case structure. 2 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.