06-16-2016 07:42 AM
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.
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.
Anybody could help me please?
Thanks in advance
Baran
Solved! Go to Solution.
06-16-2016 07:59 AM
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
06-16-2016 08:34 AM
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.
06-16-2016 08:34 AM
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?
06-16-2016 08:37 AM
06-16-2016 08:54 AM
@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
06-18-2016 01:38 AM
Many thanks Palanivel.
My problem solved with your answer.
And also thanks for other answers.
06-18-2016 11:12 AM - edited 06-18-2016 11:13 AM
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.