LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass cluster from main vi to sub vi?

Hello,

I am currently working with a main VI which has about 30 controls that need to go to various sub vi's.  I tried placing the controls in clusters and pass them to the subvis, to keep the code managable but have had no success.  Is there a way to pass many controls through one input to a subvi?

Thanks,

Azazel

Message Edited by Azazel on 11-18-2005 10:52 AM

Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 1 of 7
(2,781 Views)
Highlighted
The cluster you have in the subVI should match the cluster you create in the main but if you don't have a broken wire between the main and subVI, everything should work just fine. Can you post your VI where you're having the problem?
0 Kudos
Message 2 of 7
(2,771 Views)
Highlighted
Yes, a cluster can be wired to a subVI in the classic way. You just need to ensure that the cluster control of the subVI that is used as connector matches the cluster that you wire to it later.
 
The cluster NEED to be identical. Could it be that the cluster order of the elements is different?
 
Please attach your code and we have a look.

LabVIEW Champion. It all comes together in GCentral GCentral
0 Kudos
Message 3 of 7
(2,769 Views)
Highlighted

Hi-

 

How can I pass a cluster of any type and number of elements to a SubVI?

I tried using a reference to the cluster, but the SubVI only accepts references that have the same number of elements.

Is a polymorphic VI the only solution, or can I make it somehow work with references?

 

Thanks!

0 Kudos
Message 4 of 7
(2,474 Views)
Highlighted

OK. So it seems like I put a filled cluster into the reference instead of an empty cluster.

This created a strict reference. Changing it to a non-strict reference made it work.

 

 

0 Kudos
Message 5 of 7
(2,456 Views)
Highlighted

Dan10 wrote:

OK. So it seems like I put a filled cluster into the reference instead of an empty cluster.

This created a strict reference. Changing it to a non-strict reference made it work.


 

Sorry, I don't understand your terminology....
 
  • What is a filled cluster vs. an empty cluster?
  • What exactly created a strict reference? ("this" = ?)
  • Changing what to a non-strict reference? ("it" = ?) 

LabVIEW Champion. It all comes together in GCentral GCentral
0 Kudos
Message 6 of 7
(2,453 Views)
Highlighted

In my first attempt, I created controls in the SubVI by right clk create reference and then change to Control. This created a strict reference.

In the second attempt, I create a Contr Refnum and a Cluster from the Modern subdirectory. I put the Cluster into the Refnum. This created a non-strict reference.

By defining the non-strict controls as the inputs of the SubVI the problem was solved.

0 Kudos
Message 7 of 7
(2,442 Views)