ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cluster

Hi! When I've defined an output cluster with 8 elements,
how can I write only 3 values in this cluster, because the other 5 I don't need right now??
0 Kudos
Message 1 of 5
(3,252 Views)

Hi

I usually create a constant of this cluster, wire it to a bundle by name node, wire the necessary values and wire the output to the cluster terminal.

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 2 of 5
(3,246 Views)
Use the Bundle by Name function in the Cluster subpalette. Wire the cluster value or a corresponding constant to the function input (you can create the constant right-clicking on the cluster terminal and selecting Create->Constant), then select the names of the elements you need.
Finally wire the output to the indicator.
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 3 of 5
(3,245 Views)

It would be better to wire the cluster value than a constant cause the unwired entries will take the value of the constant. If your use a local var of your cluster, the unwired entries will keep the same value.

 

Yann

Yann Falevoz
R&D Engineer, Instrumentation & Software
0 Kudos
Message 4 of 5
(3,227 Views)
If there's a while loop it would be better to use a shiftregister if there is data written at several places. This reduces the memory usage as no locals are necessary.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 5 of 5
(3,224 Views)