LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI timing influenced by mouse actions

Solved!
Go to solution

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:

Jascha_Eisenberg_0-1677571053180.png 

Jascha_Eisenberg_1-1677571089168.png

 

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.

0 Kudos
Message 1 of 11
(1,669 Views)

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.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 11
(1,657 Views)

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

Jascha_Eisenberg_0-1677573379433.png

 

0 Kudos
Message 3 of 11
(1,648 Views)

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).

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 11
(1,630 Views)

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.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 11
(1,613 Views)

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:

Jascha_Eisenberg_0-1677579762434.png

Main:

Jascha_Eisenberg_1-1677579784148.png

Sub-VI:

Jascha_Eisenberg_2-1677579798007.png

 

0 Kudos