LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Get the best graphical performance

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:

  • is the performance of LoadPanel() affected by the size of the whole uir file, or by the size of the panel to be loaded? Is it a good idea having more than a panel in a single uir, if the uir size is more or less 100MB? I think there should be no difference...
  • while updating tables, the performance increases if they're set as invisible before updating, and set as visible at the end. When a panel has been loaded, but not displayed yet, is the graphical performance affected by hiding or showing controls? I don't think so, because I think that if a panel is not displayed, all its controls are invisible, but I'm not sure...

Thanks

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 1 of 7
(3,346 Views)

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

0 Kudos
Message 2 of 7
(3,309 Views)

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 Smiley Sad (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?

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 3 of 7
(3,237 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 7
(3,230 Views)

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

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 5 of 7
(3,226 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 7
(3,220 Views)

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

0 Kudos
Message 7 of 7
(3,186 Views)