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: 

Array to cluster from one Sub VI to another Sub VI

Hi,

   I have a Sub VI which consists outputs of all six 1D arrays of booleans (single array has 9 to 10 booleans) and i have to use them in another Sub VI in the same program by which i can change the status of individual booleans.

'' A professional is someone who can do his best work when he doesn't feel like it''...........
0 Kudos
Message 1 of 10
(2,616 Views)

is this what you mean?

cluster.PNG

Or can you be more specific?

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
Message 2 of 10
(2,596 Views)

Hi Msony,

 

use Bundle/Unbundle as shown by Koen.

 

I would strongly suggest to learn to use type-defined clusters to use (Un)BundleByName and to easy applying changes to that cluster across several VIs...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 10
(2,593 Views)

Msony wrote:

   I have a Sub VI which consists outputs of all six 1D arrays of booleans (single array has 9 to 10 booleans) and i have to use them in another Sub VI in the same program by which i can change the status of individual booleans.


It is not clear. The post title, you mentions "cluster", but the body of the post does not. What datatypes do you actually have?

 

What is your question? Do you have problems changing booleans in arrrays? Problems with using subVI connectors? How are you trying to "change" them, whatever that means.

 

Please attach a simplified set of VIs that demonstrates the problem. Thanks!

0 Kudos
Message 4 of 10
(2,588 Views)

An edit to my reply,,

 

This is probably the way GerdW meant (better solution):

cluster.PNG

The big pro of this system is that you can give the different elements of the cluster a custom name.

When you unbundle you also have the option to only chose one element.

Only con to this concept is that it takes more space in general. But it makes things more clear especially when you use the cluster over different Subvi's! 

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
0 Kudos
Message 5 of 10
(2,580 Views)

Hi,

  This is my Sub VI..

I have the 1D array of booleans as output, i have to take them into another Sub VI to toggle their states by making the port pins high/low of daq card according to my application.

'' A professional is someone who can do his best work when he doesn't feel like it''...........
0 Kudos
Message 6 of 10
(2,573 Views)

Hi Msony,

 

and what's the problem here? You already have those boolean arrays as outputs of your VI, so you just need to wire them to your next subVI...

 

Btw. I would store those booleans as arrays (or even U8/U16 numbers) inside your cluster. Much less effort: DAQmx also takes unsigned numbers to output DO values and you don't need to convert from cluster to array (and vice-versa) constantly...

 

This one is the same as your VI, but without local variables and case structure:

check.png

Plus it automatically adapts to changes of your boolean clusters inside the big cluster...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 10
(2,568 Views)

Hello, 

 

If this is Subvi who transmit it's data to a second subvi (correct me if I'm wrong) why would you already unbundle.
If my statement is correct you can better transmit the whole cluster itself

 

error.png

Btw you have to connect to error outs the error ins of the different property nodes.

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
0 Kudos
Message 8 of 10
(2,567 Views)

Hi Koen,

 

why would you need to wire all the error cluster lines?

That's only needed to enforce DATAFLOW, but in this case it's already done by the case structure itself...

 

The OP may use this subVI similar to a "property VI" in an OOP-like style: you feed the cluster (the OOP object) and you get the data (OOP properties) for subsequent processing...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(2,563 Views)

Hello,

 

Ok, sorry that's my mistake then.

I guess you are right, it isn't necessary to enforce the data flow.

 

Koen

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
0 Kudos
Message 10 of 10
(2,554 Views)