LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying child clusters in a tab control

I have a data structure comprising of 2 clusters, each cluster has 4 sub clusters. I also have 2 tab controls, one for each parent cluster. I want to display the contents of each sub cluster on its own tab page.

My thoughts so far have gone towards placing a cluster in each tab page and copying or linking each sub cluster into them, but this seems very inefficient. If anybody has a suggestion on how best to approach this, I would appreciate it.

Ed
_____________________________
- Cheers, Ed
0 Kudos
Message 1 of 7
(3,296 Views)
If you haven't already done so, you should create typedefs of your clusters. It will save you lots of headaches down the road if you change the structure.

You will obviously need to put the subcluster as a control on the front panel. However, you can minimize the impact by passing around the value of the cluster(s) in shift register(s). When you make changes to the individual cluster element you are going to update the value in the shift register. This way, you only have one place where the data resides: in the shift register.

Attached is a simple example in LabVIEW 8.2.
0 Kudos
Message 2 of 7
(3,280 Views)
After about an hour of playing, I have decided that my best approach is to use typedefs, as you say, to keep the same controls on each instance of the clusters. Then use databinding to keep the data the same on each instance of the cluster

*EDIT

Oops, I don't mean databinding. Blast I've confused myself now. Maybe it's just time for me to have a break,


Message Edited by yenknip on 12-06-2007 05:20 PM
_____________________________
- Cheers, Ed
0 Kudos
Message 3 of 7
(3,256 Views)
Hi Yenknip,

You don't need to display the data in the same way you store it on the block diagram. If I was doing this I would typdef all the clusters (even the top level on containing all the sub clusters) and move the data around the block diagram using just the top level cluster. To display it on the front panel, you just need to unbundle the requisite clusters.

Regards

Jon B
Applications Engineer
NI UK & Ireland
0 Kudos
Message 4 of 7
(3,229 Views)
I believe I want something like this. My sub clusters are displayed on their own tabs, and in the block diagram they have been made members of the parent clusters for ease of sending them to sub VIs.

The updating of the display clusters seems slightly long winded, and given this application is going to be fairly large I'm sure there must be a better way of implementing this. If anybody has some ideas or suggestions I would be grateful.

cheers, Ed
_____________________________
- Cheers, Ed
0 Kudos
Message 5 of 7
(3,207 Views)
Hi again Yenknip,

You can access the elements of a subcluster directly with the bundle by name function. I have attached a modified version of your vi where I have done this with one set of clusters.

Regards

Jon B
Applications Engineer
NI UK
0 Kudos
Message 6 of 7
(3,201 Views)
That is essentially an extended version of the example I had previously provided.

One suggestion: Unless you're explicitly doing something in the Timeout case of the event structures, there's little reason to cause it to fire every 50 msec. However, in order to eliminate this firing you would need to combine the event structures into one, which is pretty easy to do.
0 Kudos
Message 7 of 7
(3,194 Views)