LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Subpanel in tab control not responding

Solved!
Go to solution

@volfi wrote:

 Is it also possible to have only on subpanel (placed outside the tab control) and depending on which tab is activated change the subvi which is loaded to the subpanel ?


Yes of course. You only need to change the loaded VI in the subpanel when the user changes tabs. (pretty similar to the code of your first try)

But why would you use a tab control for that anyway? The tab control is mainly used to organize frontpanel elements. In your case two subpanels. If you only have one subpanel there isn't much left to organize. So  I would let the user change the loaded sub-VI via a button or an enum instead.

 

Best regards

ʍolɟɐʇɐp ʞuıɥʇ
0 Kudos
Message 11 of 21
(932 Views)

Ist just something I wanted to try, I know you'd never use it that way.

 

I tried to implement it loading a different path in each tab, however the front Panel does not respond when I change tabs. Could you give me a hint?

0 Kudos
Message 12 of 21
(929 Views)

volfi wrote: Could you give me a hint?

 

My hint is: you might need to read some basics about the event structure first. Maybe have a look at some examples. And when you are new to event structures keep in mind that in 99% of all cases you only need one single event structure. (not two as you have in your code)

 

Best regards

ʍolɟɐʇɐp ʞuıɥʇ
0 Kudos
Message 13 of 21
(925 Views)

@volfi wrote:

thanks that does the Job! Is it also possible to have only on subpanel (placed outside the tab control) and depending on which tab is activated change the subvi which is loaded to the subpanel ?


This is precisely the suggestion I made earlier, except instead of a Tab Control (which is clumsy, problematic, etc.), use something like a Boolean Radio Button control or an Enum or a ListBox or a Boolean (if you have only two choices), anything except a Tab Control.

 

Bob Schor

0 Kudos
Message 14 of 21
(919 Views)

Ok thanks. How can I change between two different cases (the two different paths) with only one Control in an event?

0 Kudos
Message 15 of 21
(917 Views)

@volfi wrote:

How can I change between two different cases (the two different paths) with only one Control in an event?


I would load and start the sub-VIs in a FOR-loop to get an array of VI-references. Then use an enum to index this array in the event of a value change of this enum.

This makes your code quite simple, plus you can add as many sub-VIs to your enum as you want in the future without much effort.

 

Best regards

ʍolɟɐʇɐp ʞuıɥʇ
Message 16 of 21
(910 Views)

Improving upon the earlier response from 'crabman', this makes the front-end a little simpler.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
Message 17 of 21
(894 Views)

I tried to do as you suggested. There is however an error when I read the VI reference from the Array. Where is the Problem?

0 Kudos
Message 18 of 21
(888 Views)

You are reading an empty array of default VI references.  You aren't using the array of references that you built up before the loop.

0 Kudos
Message 19 of 21
(885 Views)

Your front-end doesn't look at all like I showed.  As RavensFan had mentioned, you pass the array into the Event structure then choose to ignore that array as the input to the Index Array.  Additionally, you are only closing the current panel upon exiting the loop.  This may cause problems later with the other panels still open then re-running your _top.vi and NOT being able to access the unclosed vi.  It may not show as an error for it will try to open a copy of the original slide_?.vi

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 20 of 21
(879 Views)