LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I give the "user interface thread" higher priority?

We do alot of activex calls to front panels. We need to increase/decrease the priority of the user interface thread to resolve our thread problem. Anyone know how to do this?
 
Chuck
0 Kudos
Message 1 of 4
(3,284 Views)

Have you gone into the vi properties:"Execution" and tried changing the settings for "priority" and "prefered executions system"?. Other than that I don't know of any thread priority adjustments you can do from within LabVIEW

P.M.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 4
(3,281 Views)

You have not given a lot of details to work with. My answer applies to my understanding of your Q.

Property nodes execute in the UI thread. The UI thread is single threaded. Bumping up the priority of the UI will not help.

It seems you should be doing LESS UI stuff. Concider doing the ActiveX stuff less often, more efficiently or not at all!

Painting a racing stripe on your car will not make it go faster! If you want it to go faster, toss the elephant in the back seat.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 4
(3,268 Views)

Hello,

 

As P.M. was saying, you can adjust the thread priorities through the VI Properties dialogue.  Another place to modify the multithreading system in LabVIEW is a VI located at: [LabVIEW Directory]\vi.lib\Utility\sysinfo.llb\threadconfig.vi.  However I do not think this will remedy any problems you are having.

 

From a Multithreading in LabVIEW tutorial (http://zone.ni.com/devzone/conceptd.nsf/webmain/d2e196c7416f373a862568690074c759) :

 

Priorities in the User Interface and Single-Threaded Applications
Within the User Interface execution system, priority levels are handled in the same way for single-threaded and multithreaded applications.

In single-threaded applications and in the User Interface execution system of multithreaded applications, the execution system queue has multiple entry points. The execution system places higher priority VIs on the queue in front of lower priority VIs. If a high-priority task is running and the queue contains only lower priority tasks, the high-priority VI continues to run. For example, if the execution queue contains two VIs of each priority level, the time-critical VIs share execution time exclusively until both finish. Then, the high priority VIs share execution time exclusively until both finish, and so on. However, if the higher priority VIs call a function that waits, the execution system removes higher priority VIs from the queue until the wait or I/O completes, assigning other tasks (possibly with lower priority) to run. When the wait or I/O completes, the execution system reinserts the pending task on the queue in front of lower priority tasks. Refer to the Synchronous/Blocking Nodes section for a list of asynchronous functions that wait.

Also, if a high priority VI calls a lower priority subVI, that subVI is raised to the same priority level as the caller for the duration of that call. Consequently, you do not need to modify the priority levels of the subVIs that a VI calls to raise the priority level of the subVI.

 

Thus changing the priority of your VI will change the priority of UI calls for that particular VI.  Again, I caution you because I suspect that if you are having problems with your application not running correctly, I do not believe that manipulating the thread priorities will resolve these issues.

 

Hope this helps,

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 4 of 4
(3,253 Views)