LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure in case structure

Hello
I have a tab Control connected to a case structure. On one tab i have some Radio Buttons. The Radio Button Control is connected to a second case structure. There are also three numeric controls. Every time one of these controls change values I have to calculate something. So, I decided to use an event structure. (See picture)
I have now the problem, that the VI doesnt react on the stop Button correctly. Sometimes it reacts on it and sometimes it doesnt. Then I have to change a value to end the VI.
Is there another way to detect if a numeric control's value changed?
 
0 Kudos
Message 1 of 4
(2,780 Views)

You should not have multiple event structures in the same loop and inside cases. That's just a recipe for having your FP become locked and unresponsive and for all sorts of weird things.

Let's assume you want the code in the value change to execute only when the tab is in that page and only when that specific radio button was selected. In that case, what you should do is reverse the order - the event structure should be on the outside and the case structures should be inside the event structure. If the radio button can't change if the tab page isn't shown, you don't even need the case checking for the tab page.

Once you did this, you can simply add a value change event for the stop button and wire T out of that case into the stop terminal. Once you press the button, that event will execute and the loop will stop.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
 
The style guide and chapter 17 of the manual should cover more about events.

___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(2,769 Views)
Thanks for the answer
It just doesn't semm very logical to me to reverse order.... But if this is the only way I'll do it.
0 Kudos
Message 3 of 4
(2,758 Views)

It's not the only way.

You could also, for example, add a timeout, so the loop iterates not only when there's an event.

My suggestion was based on my not liking having event structures inside case structures. This should definitely not be if you have event structures in your other cases, and that's even metioned in the help for the event structure. Without looking at your full code, it's hard to suggest a definitive answer.


___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(2,753 Views)