LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event problem, control does not working

Hi !

I have "Tab Control" and there is both pages a Stop button.
If there is first selected page1 and i run vi and then i select page2
and i try push Stop2 button nothing happens.
Whats is the problem ?

page2 Stop2 button works if there is first selected page2.
page1 Stop1 button works OK.


See attachment.

-HeVi-
0 Kudos
Message 1 of 6
(2,978 Views)
Hi HeVi

you need to specify a timeout, otherwise the following happens:
Whenever you select the first tab, you enter the 'Page 1' case. As there's no timeout value specified, the only way out of that case is the stop button of the first tab.
Don't get irritated that you can switch to the second tab on the front panel, is still 'caught' in the event structure.

-B2k
0 Kudos
Message 2 of 6
(2,972 Views)
Okay ! , Thaks a lot.

Time out need to be both pages (new attachment is now working right)

One more question.

When i select tab control page2, i want to make one init round, that
i know the status of equipments.
It's like first timeout round should do initialisation.

How i make it ?

-HeVi-
0 Kudos
Message 3 of 6
(2,963 Views)
Hi HeVi,

do you mean something like this?

-B2k
0 Kudos
Message 4 of 6
(2,957 Views)
Hi -B2k !!!!!!!!!

And yes, exactly thats is what i mean.

Thank you and i salute you !!!!! ;o)

-HeVi-
0 Kudos
Message 5 of 6
(2,955 Views)
OK, take a few steps back and look at your code from scratch! 🙂

You seem to be under the false impression that a tab control needs a case structure on the diagram. Don't micromanage your code! A tab structure is just an easy way to simplify the front panel. From the perspective of the code, you can assume that all controls of all tabs are always visible. (If execution should depend on tab position, place the case structure inside the event structure. ;))

See also my earlier comments here.

You should never place event structures inside cases (or even worse, multiple event structures in multiple cases of the same case structure). Having to add unecessary timeouts is just a kludge to hide a poor program design. More comments can be found at the end of my other post.

Don't add timeout events unless you really need to do something important at regular intervals. Most of my event structures don't use the timeout event at all.

Also, if a stop button should be accessible independent of tab position, it should probably NOT be on the tab structure, but next to it! 🙂 Alternatively, you can "float" a single stop button on top of the tab structure as follows: Select the stop button, then, using only the arrow keys, move it to the desired location on top of the tab structure. While editing, the stop button will have a shadow to indicate that it is not part of the tabs. This shadow disappears while running.
Message 6 of 6
(2,933 Views)