ldindon
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Gallery
Posts posted by ldindon
-
-
QUOTE (Mark Yedinak @ Mar 5 2009, 04:34 PM)
As Ton mentioned this is a risk of event driven applications. However I would have to ask why you would need to display the changes that frequently. I would question the design in this case and look at your architecture. There is no reason to update a UI display that frequently. A person will not be able to see the updates at that rate and therefore there is no benefit for updating the display that quickly.Off course I do not need to update the display that frequently.
Unfortunately the XControl architecture does not allow (as far as I know) to update the display less frequently.
Each time the data changed the XControl facade ability vi is called to handle the event then the event structure timeouts and the vi exits.
If in the meanwhile someone has changed the XControl value 10 times, then 10 events will be stacked somewhere by Labview. It will result to 10 different calls to the XControl facade vi to handle the events one by one. When you are handling an event you did not know that 10 others of the same type are waiting so there is no room for optimization by handling only the last one in the queue and skipping the others.
A solution would be to invalidate the display each time the data changed and to update it asynchronously outside the XControl facade vi at a reasonnable refresh rate for instance. But I have no idea how to achieve such a solution with the XControl "API".
-
Hi,
I noticed that if your are not able to handle DataChanged events of a XControl fast enough, events will be then stacked causing desynchronization
between the data and the display.
I have attached a project (LabVIEW 8.6) with the XControl and a simple example (Test.vi) that demonstrates the problem:
- The load inside the DataChanged event handler of the XControl is simulated by a "wait for 50 ms".
- The data of the XControl is changed each 10 ms.
I have also attached some screenshots for those that do not want to run the example.
Is there a way to avoid that?
XControl DataChanged events stacking
in User Interface
Posted
QUOTE (Mark Yedinak @ Mar 5 2009, 05:47 PM)
I will not be the end user of the XControl so I have to handle the bad usage of it. My XControl must have the same behaviour as a standard LabVIEW Control.
For instance the LabVIEW Gauge is able to handle a value changed at high frequency even if it makes no sense to update it so fast.
QUOTE (Mark Yedinak @ Mar 5 2009, 05:47 PM)
When you said "Internally", do you mean inside the XControl? If the answer is "yes" I do not understand what you mean.
QUOTE (Mark Yedinak @ Mar 5 2009, 05:47 PM)
Thanks I will have a look at this thread.
Note: I have attached a screenshot of my Gauge XControl used for prototyping. It does not use ActiveX or .NET and it is multi-platforms (tested on Windows XP and Linux).