08-06-2009 06:55 AM
Hi All,
LabVIEW 2009 + DSC
In following project example there are XControl 1 and tester.vi. My target was build flexible display object (XControl 1) because my user interface is varying lot depending current customer configuration. The amount of these XControls are typically 100-200 pieces per display. The problem is that this code structure generates lot CPU load(even it is very simple). This can be seen easily when tester.vi is set to run. In generally is there any way to improve XControl perfomance?
Solved! Go to Solution.
08-06-2009 07:25 AM - edited 08-06-2009 07:26 AM
You are a bit optimistic when you are posting the 2009 version, not that many have had a chance to get their hands on it yet
08-06-2009 07:42 AM
I am still at NI week, so I don't have much time to look into that, but I would try to avoid overlapping objects in the xcontrol (and also make the numeric indicator large enough so the "100" is not clipped). See if performance improves...
08-07-2009 12:10 AM
08-07-2009 07:48 AM
Some ways to increase performance:
08-10-2009 01:50 AM
Hi,
Thank you very much for these tips. I will implement these tips and do some tests.
This popup dialog (point 3) can be launched only when calling VI is not running. This XControl's main target is to help customize our user interface. So this popup will be launched only once per application (when programmer is doing customation). Is this point 3 really an issue if popup can be launched only when VI is not running?
08-10-2009 07:46 AM
Make sure you follow Altenbach's tip, as well, since it can give you a huge performance boost.
I am not an XControl expert, so I cannot definitively answer your second question. I do not think it would be a problem, but do not really know. However, as a developer, I am very leery of anything which can be misused or copied and misused in the future. If you leave it, make sure you put big warning text labels around it so no one copies it for runtime use. My personal preference would be to fix it.
08-11-2009 02:54 AM
Hi,
I implemented all performance tips which where suggested. I didn't noticed signifigant improvement. This means that my computer CPU load is 86% while running "tester.vi". I also disabled "allow debugging" option from facade.vi. This decreased CPU load to level ~80%. Still CPU load level is a far away from that level what we need. I changed yellow led-indicator to yellow decoration. I also relocated indicators and decoration so that there is no overlapping.
It seems that only way get this code effcient is change overall structure. Of course if I only update those XControls whose values are changed code performance will be better. That needs huge event structure or something else. Also the updating of our display must be done "manually". So after all there is no reason use XControl...
Newest version is attached
08-11-2009 08:26 AM
Your XControl is probably about as efficient as it is going to get. You could wring a bit more performance out of it, but I don't think it will be significant (execution time was 1ms on my machine, about 20% CPU time - 3GHz Intel Core2 Duo running Vista64). I agree with you that your best bet is to only update the controls you need to update, especially since you have this information. You are also correct, that to be efficient, you would need a giant case structure containing the terminals or locals. You could do it inefficiently, but more transparently, by using the Value property and an array of references, but given your computing constraints, I would not recommend this.
08-11-2009 08:47 AM - edited 08-11-2009 08:53 AM
Ideas that may help performance.
1) Track the previous values displayed and only update the indicators when they change. In my X_Controls I wrap the terminal in a case so I only update the FP if a change happened.
2) Instead of using an array of cluster try using two arrays so you can do a "search 1d array" rather than unbundling and comapring element by element.
3) Make "Object Postition" a "U8".
Just trying to help,
Ben