SubVI Being Used as a Popup Window Does Not Work Properly From the Second Call

Updated Jul 2, 2019

Reported In

Software

  • LabVIEW
  • LabVIEW Base
  • LabVIEW Full
  • LabVIEW Professional

Issue Details

I developed a LabVIEW program in which when I press a control button in the main VI, the front panel of a subVI pops up for a configuration purpose. This configuration window also has several controls and indicators and is implemented with the event structure. On a first run, the subVI's buttons work properly, but after close and reopen it, the control buttons of the subVI are freeze. What is the reason for this problem?

Solution

If it does not work from the second run, you have to figure out what conditions have been changed compared to the first run. For example, If you do not release dynamically generated resources before the subVI terminates, you may encounter problems from the second run.
If you use the event structure with user event or dynamic event in the subVI, you should check if you release the registration. If you register the same event at the second run without releasing the registration, the program may not work properly.
As shown in the figure below, the dynamically created event resource is released through Unregister For Events node and Destroy User Event node.