User Interface on Front Panel Locks up When Running LabVIEW Application

Updated Aug 28, 2023

Reported In

Software

  • LabVIEW

Issue Details

  • My User Interface (UI) on the Front Panel locks up when using Event Structures. All my controls seem disabled and my graphs and indicators don't seem to update. My stop button does not stop the program from executing. Why is this happening?
  • I notice when running my LabVIEW application, the Front Panel locks and I can not move anything such as Splitter Bars that I had added to the Front Panel. Why is this?
  • I am using a Queued Message Handler (QMH) but my producer loop is not registering Front Panel control events. What could cause this?

Solution

While the Front Panel appears to be frozen or disabled, it is possible that the event registered in the Event Structure queue has not finished executing.

To check this, right-click the Event Structure and open the Event Inspector Window to see if there are multiple events loaded into the event queue. Figure 1 below demonstrates that the "stop 47.2" boolean was clicked 9 times, causing multiple events to be triggered and loaded into the queue. As a result, the User Interface will be locked until all events have been handled.
 

Figure 1. Event Inspect Window - Multiple Boolean Click Example

Some common scenarios that cause the Event Structure queue to fill up quickly can be found below:
  1. Rapidly clicking a control that is also registered as a "value change" event.
  2. Multiple Event Structures in a While Loop and mistakenly assigning multiple identical events for a Front Panel control.
  3. Implementing the Event Structure in a state machine architecture while not regularly returning to the "Waiting" state for the Event Structure to process the user inputs.
  4. If a QMH architecture has been implemented, it may be that the message queue has reached the maximum number of elements that it can contain.
    • To verify if this is the case, locate the Obtain Queue function in the project and make a note of the value assigned to the max queue size input. Note that a value of -1 indicates that the queue can hold unlimited elements.
    • Place a Get Queue Status function in the producer loop before any elements are dequeued. Ensure that the return elements? (F) input is set to true and then place an indicator on the # elements in queue output. Verify that the maximum number of elements has not been reached.
    • If the queue is hitting it's maximum capacity, consider adding timing to the producer loop to control the rate at which messages are queued and dequeued.
While these solutions may work, a better solution for programs with time intensive processes is to implement the project using a Producer/Consumer architecture.

 

Additional Information

When a Front Panel object event occurs that has been registered in an Event Structure event case, the Front Panel, by default, locks until the object's event case completes execution. Due to this, problems can arise when executing time intensive operations, While Loops, and/or Event Structures inside of the event case. While not recommended as best practice when developing event-based programs, the default "Lock Panel" feature can be turned off individually for each event case. To do this, complete the following: 
  1. Right-Click on the event structure border
  2. Select Edit Events Handled By This Case... from the Edit Events menu that appears
  3. Uncheck the box at the bottom of the window that says Lock panel (defer processing of user actions) until the case for this event completes as shown below in Figure 2. 
Figure 2. Edit Events Window