User Interface on Front Panel Locks up When Using Event Structures

Updated Jan 29, 2019

Reported In

Software

  • LabVIEW

Issue Details

My user interface 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?

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.

 

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

While these solutions may work, a better solution for programs with time intensive processes is to implement the project using a Producer/Consumer architecture.

WAS THIS ARTICLE HELPFUL?

Not Helpful