LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting a Higher priority for Front Panel Events in an Event Structure

Solved!
Go to solution

Hey folks,

 

I need some advice on Event Handling in Labview 2013.... I have an event structure that handles front panel events (Button presses) as well as some user events. Now user events come in thick and fast from an external dll. The data along with this events gets queued initially and then plotted / processed.

 

The tricky part is if there are huge number of user events, then the response to front panel event is significantly delayed. I get about 80 user events back to back every two seconds. So if i press a front panel button every two seconds (like 2 seconds, 4 seconds, 6 seconds... etc) the response is visibly delayed as opposed to pressing it in multiples of 3 seconds (3 seconds then 6 seconds, 9 seconds....) where the response is immediate.

 

Now i know labview 2013 supports two prioritres while generating user events (High & normal) but the catch is in my case, the user events come from a dll using the "PostLVUserEvent" method which does not accept a priority. And i dont see a way of setting a priority for the front panel events (button presses). 

 

Any thoughts on how this can be handled?

 

Thanks in advance, Regards, Abel.

 

0 Kudos
Message 1 of 3
(2,645 Views)
Solution
Accepted by topic author DsouzaAbel

The best solution would be separating user and FP events in two independent loops, however I understand this may be difficult if the two classes of events act on the same data.

Another possibility is to use two serialized loops, encapsulated together in a larger loop, each containing an event structure: the first, with a short timeout, would handle FP events and would exit on timeout; the second would handle all user events and would be forced to stop after a predefined number of handled events or, better, when a predefined amount of time has elapsed.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 2 of 3
(2,633 Views)

Thanks Paolo,

 

i went with the approach of having a seperate event structure to handle front panel events. This seemed to be the must logical and simplest method. Front panel events are not tied to any data and i could seperate it out in a different loop with ease.

 

Thanks 🙂

0 Kudos
Message 3 of 3
(2,605 Views)