02-28-2023 02:00 AM
Hello everyone,
I have noticed in my application, that selecting a numeric control field (or simply moving the mouse over a control or a chart indicator) changes the timing of the application. Is there a way to disable this, to get a more repeatable timing?
Example below, when selecting the “0” in Numeric:
I found an old forum entry about this and was wondering if there is a better solution available than using a transparent decoration to cover the entire user interface.
Solved! Go to Solution.
02-28-2023 02:28 AM
Provided that you can't guarantee a constant timing unless the OS is realtime, you can improve greatly by running the code in another "worker" vi with no user interface. This vi may send the results of the processing to other vis - to be viewed or saved - using a queue or a notifier or whatever you think is best for your application. A proper way to terminate or pause the worker vi should be setup, via a Global, a Notifier, a User event, a command queue or other synchronization objects.
02-28-2023 02:43 AM
Thank you for your reply. What do you mean with a "worker" VI: a sub-VI?
The same timing happens if the loop is run in a sub-VI: If the Numeric on the caller is selected, the timing in the sub-VI is influenced.
My application is a Queued Message Handler.
Left: Caller, right: sub-VI
02-28-2023 03:13 AM
I meant a vi run in parallel with your main. But your subvi has a user interface that it constantly updates. This forces running in the UI thread and this could be the reason of the jitter.
I'm trying to replicate your test but I don't get the same bad results. I get timings from 10 to 12 whether or not I move the mouse or select the numeric. If I drop the chart, I get 10 to 11 (very seldom 12).
02-28-2023 03:57 AM
Why do you need it? Don't do timing sensitive things in the UI thread and if timing is really important, do it in a RT OS.
02-28-2023 04:25 AM
Thank you for your responses. How do I get the process into the UI-Thread?
My demo-application now uses two loops (and I changed the execution setting), but still get the same interference from the mouse over the Numeric indicator from the main-VI in the sub-VI:
Main:
Sub-VI: