05-26-2011 01:25 AM
I've been developing an application where the graphical appearance is very important, so every panel has a 1280x1024 size with a 32-bit color depth picture control as large as the panel itself used as background; moreover there are a lot of other picture controls.
In this situation, loading and displaying panels is very slow, so I need to know form some CVI developers how I can improve these operations:
Thanks
06-08-2011 02:17 AM
Hi Vix,
If your UIR is 100MB, then that is a problem. I imagine this large file size is due to images that are loaded. There are other design schemes for loading
images. You could dynamically load in images as needed. Also, most UIs don't require high resolution images unless they are display information. If the images are for decoration purposes then they can be trimmed down to a manageable size.
This is possibly affected by the table updating too many times. Are you updating the table one entry at a time with a large data set? You could update all the values, then refresh the display rather than refreshing the display after each data update
06-08-2011 03:15 AM
After having reduced the images as possible, there are 2 or 3 uir files with a size of 20MB. All the uir files are then embedded into the executable files (that is more than 100MB large).
I've already considered other design schemes for loading images, but this one is the best for my application: the problem is that the graphical performance of CVI are quite bad (as already discussed in the past)
I've been trying to get the highest performance from CVI, but the improvements are not so easy.
I don't have any particular issue with tables: it was only an example where a quite simple workaround dramatically increases the graphical performance.
You could update all the values, then refresh the display rather than refreshing the display after each data update
How can I suspend the display refreshing in CVI? I know LabVIEW has a panel property, but I haven't found any CVI function to do the same. I call ProcessDrawEvents() to force the refresh, but how can I suspend it?
06-08-2011 04:02 AM - edited 06-08-2011 04:03 AM
Table controls, the same as other controls, can be updated in two ways: SetTableCellVal or SetTableCellAttribute (..., ..., ..., ATTR_CTRL_VAL, ...). The second case does not update immediately the control: update is performed once for the whole teable when CVI processes events: this procedure is a lot faster when several cells need to be updated. This is clarified in the online help (the additional note given in the help is important too):
Using this in SetTableCellAttribute or SetTableCellRangeAttribute is equivalent to calling the SetTableCellVal or SetTableCellRangeVals functions, except that the cell does not display the value until LabWindows/CVI processes draw events.
Note: If the table control in which you are setting a cell value is the active control in the panel, the cell nevertheless displays the value immediately.
06-08-2011 04:14 AM
Hi Roberto
Table controls, the same as other controls, can be updated in two ways: SetTableCellVal or SetTableCellAttribute (..., ..., ..., ATTR_CTRL_VAL, ...). The second case does not update immediately the control
I know that SetCtrlAttribute (..., ..., ATTR_CTRL_VAL, ...) is a lot faster than SetCtrlVal (), and I always use it
06-08-2011 06:07 AM
Exactly: the same applies to tables too.
Additionally, using SetTableCellRangeVals with arrays of data is faster than lloping through the array and update individual cells.
06-16-2011 03:38 PM
Hi Vix,
To answer your original question concerning table updates, yes, hiding the panel is equivalent to hiding the control. Of course, if you can use SetTableCellRangeVals, as Roberto suggested, or FillTableCellRange, that's by far the best option.
Concerning the slowdown of loading a panel with a large image, I tried to reproduce the problem by loading a 1280x1024 panel containing only a 1280x1024 picture control holding a very large image (3206x1206), and it loaded almost immediately. So there must something else about your setup that I don't have. If you attach a test program that manifests this slowdown I'll be happy to profile it internally, to see if there's anything I can do to make it load faster. The same applies to your table updates.
Luis