11-04-2013 01:01 AM
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.
11-04-2013 02:24 AM
is this what you mean?
Or can you be more specific?
11-04-2013 02:28 AM - edited 11-04-2013 02:44 AM
11-04-2013 02:39 AM
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!
11-04-2013 03:06 AM
An edit to my reply,,
This is probably the way GerdW meant (better solution):
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!
11-04-2013 03:44 AM
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.
11-04-2013 03:55 AM - edited 11-04-2013 04:10 AM
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:
Plus it automatically adapts to changes of your boolean clusters inside the big cluster...
11-04-2013 03:59 AM
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
Btw you have to connect to error outs the error ins of the different property nodes.
11-04-2013 04:02 AM - edited 11-04-2013 04:04 AM
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...
11-04-2013 04:04 AM
Hello,
Ok, sorry that's my mistake then.
I guess you are right, it isn't necessary to enforce the data flow.
Koen