From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with tab control and event structure

Solved!
Go to solution

Hi

 

My program has a tab control. In each tab, I have an event structure for controling some events.

 

I have encountered with some problems. These are:

 

1- In each tab, I defined tab control as an event, to quite from the event structure as tab changes (e.g. picture below). My first problem is that when I change tabs, in the next loop as my program entered in next tab environment, it goes to the event: main tab value change! And gives wrong result.

 

00.JPG

1.JPG

2- I programmed two final tabs as image bellow. I didn't have any subprogram in these two tabs. Just I want when I change the tab, it goes to the next tab control case. But when I run the program, it goes to something like busy after one or two tab changes, and didn't work properly.

 

3.JPG

 

Anybody could help me please?

Thanks in advance

Baran

 

0 Kudos
Message 1 of 8
(5,400 Views)

I dont guess you require this many Loops for any requirement

 State your requirement in steps which will be eaily understandable for others to provide useful tips

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 2 of 8
(5,393 Views)

First of all, you should only have 1 event structure in your VI.  You can have one event structure handle all of your tabs.  You can also use the Timeout event to do special things based on which tab is viewable.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 8
(5,383 Views)

I want to have 4 tabs, in each tab having 3 boolean control.

If in each tab any boolean control gets 1, a subvi should be run.

 

I wrote this code with a while loop inside each tab that hase 3 cases for each boolean control. The result was true.

But I think if I write it with an event structure inside each tab instead of 3 cases, the cpu load will be less.

 

Isn't it true?

0 Kudos
Message 4 of 8
(5,382 Views)
Solution
Accepted by topic author barana

@barana wrote:

I want to have 4 tabs, in each tab having 3 boolean control.

If in each tab any boolean control gets 1, a subvi should be run.

 

I wrote this code with a while loop inside each tab that hase 3 cases for each boolean control. The result was true.

But I think if I write it with an event structure inside each tab instead of 3 cases, the cpu load will be less.

 

Isn't it true?


Make a single Event Structure .

Add Events for All the controls (Boolean Buttons)

When the event is triggeredcheck for the active Tab control and decide which sub vi to run

 

This will work fine you

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 6 of 8
(5,372 Views)

Many thanks Palanivel.

My problem solved with your answer.

 

And also thanks for other answers.

0 Kudos
Message 7 of 8
(5,323 Views)

The problem is that you think you need to unecessarily complicate and micromanage the code. The code does not need to know what tab you are on. It can fully conclude that from the fact that a certain control was operated.

 

See also this old discussion.

0 Kudos
Message 8 of 8
(5,288 Views)