LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with listbox value change event

Solved!
Go to solution

Hi

 

I have a problem with using Listbox value change event. The code I attached is a simplified version of bigger program but the problem is the same. One of shile loops is responsible for handlig occuring events ant the second one is responsible for running the program. In the oryginal project I am using a listbox control to determine which of the plots displaying on one waveform chart is visible (first position from listbox -> only first plot visible etc.). In the attached vi I'm just displaying the current value of listbox control. The problem is the event executes only once and then the program freezes. I want to be able to change listbox value both in idle and in work state of a program but when i put the same event structure in both states it doesn't work. I would be very grateful if someone smarter than me could tell me where i made my mistake. I would like my program to be able to handle events from buttons and from listbox in both (idle and work) states of the program.

 

 

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

You have two event structures in two different cases of the same case structure, and both are listening to listbox changed events. Since only once can fire at any given time, the VI locks up (events lock the front panel (by default) until the event can complete).

 

You should use one single event structure handling all events.

 

The entire program architecture looks inside-out to me.

For the buttosn, you should use latch action (not switch until released!) and use value changed events instead.

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

Thanks a lot 🙂 I just removed the case structure from the event handling loop and everything is workig correctly.

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