03-26-2014 06:02 PM
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:
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?
03-26-2014 06:27 PM
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.
03-26-2014 09:35 PM
03-26-2014 11:13 PM
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.
03-27-2014 03:57 AM
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?
03-27-2014 04:04 AM
03-27-2014 09:21 AM
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.