LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop defaults being passed into a bundle

...

Or you could add another control which is a cluster of booleans that will let the caller specify which values in the cluster should be touched.

 

Seelctive.png

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 21 of 22
(891 Views)

Here's one way to fix this so that it does "what you want' rather than "what you say".  Let's assume the Cluster has an element called "Number", and you want to update this element to "New Number".  Write a sub-VI called "Update Number" with "Cluster In" and "Cluster Out" terminals, and a second Input terminal called "New Number".  Use New Number to Bundle by Name the Number component of Cluster In, passing the result to Cluster Out.  Here's what I mean:

Update Cluster Element.png

This will preserve all the existing elements of your Cluster, updating only Number.  Keep this Cluster in a Shift Register and update the elements one at a time, as you get the new values.

Note that I also included a seemingly-useless Error In/Error Out terminal -- this is often a good thing to put into your sub-VIs as it gives you an easy way to determine the order different sub-VIs will execute (by serially connecting the Error Lines in the order you wish).  Also notice the black triangles in the upper-left corner of the Cluster In/Out controls/indicators -- this indicates that these come from a TypeDef, something you should (almost) always create for your Clusters.

 

Bob Schor

0 Kudos
Message 22 of 22
(871 Views)