LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

front panel locked on tabs

hey all,

 

I have an interface for communicating with an instruement, which work great.

 

it is programed as an infinite while loop, in which there are event case for different functions.

 

when it is in a single fron panel - everything is OK.  but I want is to work in tabs!

 

for example: one tab should have COM selection and serail data inputs, another tab should have operaion function only, etc.

 

so I divided the events, put some in the first tab (for example stop button for the program) and another event in different tabs,

 

and now it working only till I change tabs and do some action - when did is done the front panel is locked.

 

I know thats mean that the event in not yet completed - by I don't know why this is the case and how to solve it?

 

I attaced two imaged for example:tab event1.jpg

tab event2.jpg

 

In both event I only press a button i.e. do some boolean operation.  I can do them when I start the program from their tabs, but once I switch tabs and press the other - I can't go back and press the first one again.

 

what could be the problem?

0 Kudos
Message 1 of 7
(2,924 Views)

You are stuck at the event structure.  the VI will wait there until an event occurs.  This architecture is asking for BIG trouble.  Generally, only use one event structure in your program. Yes there are times to use more, but this is not one of them.  After all, the user can only press a button when the tab is showing the control.

0 Kudos
Message 2 of 7
(2,916 Views)

You seem to be under the (false!) impression that you need to micromanage the tab state on the diagram side. That's not needed at all. It is sufficient to have the tab on the front panal as a means to organize the controls, but you can leave its terminal disconnected on the diagram and simply ignore that it is even there. It is not needed at all. The code works fine without it.

Use a single while loop containing a single event structure, and add event cases for any action that needs to be handled. That's all you need! 😄

 

If you want more detailed help, please attach your VI.

0 Kudos
Message 4 of 7
(2,875 Views)

Leaving the tab disconnected does simplify things a lot!!

 

I still don't understand why this is happening?

 

I do understand that the VI is waiting for an event to occur, but switching the buttons is the event! And all that needs to occur.

 

why this event doesn't consider to end once I switch the button?

0 Kudos
Message 5 of 7
(2,850 Views)
Ok. If you are trying to handle the same event in multiple structures that is a big no no and we'll definitely lock your vi. Highlight execution will definitely show you what is going on. one of the reasons not to use multiple event structures.
0 Kudos
Message 6 of 7
(2,847 Views)

mrish wrote:

I still don't understand why this is happening?


We cannot debug a picture, because there are many things that are invisible on a picture alone. For example, we cannot tell how the events are configured. By default, event lock the front panel until the event has completed. If an event cannot be reached by the code (e.g. because it is trapped inside a case that is currently not active), the VI will be locked up forever.

Event struxtures listen for events out of band. They queue up events even if they are currently not in the dataflow adn e.g. hidden in a part of the code that can never ne reached..

 

As we said, to get more detailed help you should always attach your VI. Pictures are too ambiguous.

0 Kudos
Message 7 of 7
(2,825 Views)