LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combo box to initiate event causes program freeze

Solved!
Go to solution

Hi All, 

 

I am building an application that allows an operator to specify a corrective action taken to fix a part on the line. The customer has 3 levels of repair specificity in an access database that I am using to populate combo boxes that the operators will select. Code executes like this 

 

Call SQL database to populate vague level 1 options in combobox

Event structure to save vague problem and exit, or wait for value change in combo box  

   which 

Calls level 2 values based on combo box 1 selection,

Event structure to save specific problem and exit, or wait for value change in combo box 2

   which 

Calls the level 3 values based on combo box 2 selection 

Operator saves very specific problem and data is stored. Exit VI. 

 

 

It seems that the program will freeze after making a selection. I can change combobox 1 exactly 1 time, but then it will not allow me to change combobox 2. I cannot select anything in combo box 3. Highlighting execution shows the problem is when waiting for an input into the event structure, but I can't change the values linked to the event.  I know the SQL queries work because looking at the comboboxes after stopping the program shows the correct values. 

 

I appreciate any input. 

0 Kudos
Message 1 of 4
(2,732 Views)

Can you File >> Save for previous version ... 2016?

0 Kudos
Message 2 of 4
(2,713 Views)
Solution
Accepted by topic author ace.bot

Read Caveats and Recommendations when Using Events in LabVIEW - LabVIEW 2016 Help

 

You have multiple event structures (four) in your VI, and unless you know what you are doing, you are going to lock up your program exactly like it is happening.  The event structures are buried in different cases and are registered for events to "Lock panel until the event case completes".  Well, if you click on a button that is registered, but the code doesn't have that event structure in its path of execution, then the event case is never handled or completed, and the front panel gets locked up.

 

Limit yourself to a single event structure that can always be handled by not being buried inside other structures like a case structure.  You can put the case structure inside the event structure, and ignore the event if its not the right time to handle the button press, but don't do what you are doing.

0 Kudos
Message 3 of 4
(2,695 Views)
Solution
Accepted by topic author ace.bot

Thanks RavensFan. Worked like a charm. I"m new to LabVIEW (and programming for that matter,) and appreciate you being gentle with me. 

Message 4 of 4
(2,669 Views)