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: 

How to stop defaults being passed into a bundle

Hi, 

 

I have a VI into which I write data but there are many data inputs. These input are passed to a cluster which is being updated. I will not use all of the input all the time but still want to retain the values in the cluster for the inputs I don't use, thus keeping the . essentially I will be updating different elements of the array in different part of my program. When I don't wire an input the default is fed and this is unwanted. 

 

How do i stop this from happening? I have attached the VI that I have written 

 

Thanks 

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 1 of 22
(3,757 Views)

Stephen,

 

There is no VI's in the zip, only controls.  But there are many different ways to retain data for use at a later time.  I know youre looking into an INI file in another post and you could read from the INI file to a cluster.  Also this issue could be solved with something as simple as a shift register.  Depends on your architecture.  Code would help a lot in this case.



-Matt
0 Kudos
Message 2 of 22
(3,743 Views)

Hi Stephen,

 

by using BundleByName you can update only those elements of a cluster you currently want to - all other elements will stay untouched:

check.png

Best regards,
GerdW


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

Hi Matt, 

 

yes I will be looking at saving to ini file but at this stage in the program I just would like to write or read from a cluster. I don't want to continuously be opening and closing ini files - just want to get it all into a cluster and then write to ini. 

I've attached the vi again of how I'm writing to the cluster. Follow the files its pretty long, Write to Task Info Cluster Folder 4\__ds.leeds.ac.uk_student\student2\ed12s9w\iFrep\First Project\Surgical Data Analysis\SubVI's

 

To give you a bigger picture of my VI ill send it all buts it is reasonable big and complex and so might not work/ be of use. this is the manual synchronise.vi in the following folder. Manual Synchronization Folder\__ds.leeds.ac.uk_student\student2\ed12s9w\iFrep\First Project\Manual Synchronize sorry about the paths, I can't help it being on a university pc. 

 

thanks

 

Stephen

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 4 of 22
(3,725 Views)

hi GerdW, 

 

Thanks for the suggestion however I need to use the subVI in multiple places and therefore need all the variables going into the cluster accessible from terminals. 

 

My reply above contains the VI, its the write to task info cluster one.

 

Thanks 

Stephen 

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 5 of 22
(3,723 Views)

Maybe a Functional Global will do here?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 6 of 22
(3,707 Views)

Thank you for the suggestion. I have considered FGV but have ruled them out for the following reason.

 

The VI that I need to prevent defaults being writeen to the bundle should ideally be used when populating every element in the array. That means that I will be using it for different file data and hense I won't be able to use an FGV to store the current values and then write them to the bundle along with the values I want to update, as the VI needs to pass different data to the bundle function. This would work if I used a separate VI for each element in the array but thats  not really what I need. I need something that just won't write the bundle function unless the terminal is wired. 

 

Thanks

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 7 of 22
(3,661 Views)

What you do is have an enum command that lets you tell the FGV subVI which input you are updating.  Let's say you have elements A, B, C, D.  You'd have a typedef enum that contains Set A, Set B, Set C, Set D, and a default of Get that just returns the values.  When you wnat to update element A, you set the enum to Set A, which executes the case of a case structure that puts the data into Element A.  Likewise for the other ones.

Message 8 of 22
(3,648 Views)

You can have a case to update the whole cluster at once.

 

You can also have a case for each element that you would like to update separately by making a case for that element, unblundle it inside the case, then bundle it with the FG data.

 
 
 
Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 9 of 22
(3,639 Views)

@RavensFan wrote:

What you do is have an enum command that lets you tell the FGV subVI which input you are updating.  Let's say you have elements A, B, C, D.  You'd have a typedef enum that contains Set A, Set B, Set C, Set D, and a default of Get that just returns the values.  When you wnat to update element A, you set the enum to Set A, which executes the case of a case structure that puts the data into Element A.  Likewise for the other ones.

This would work however I have too many variables that I might want to update for this to be practical. 

Labview 14.0, Labview 12.0
CLAD
Mechanical Engineering Student
0 Kudos
Message 10 of 22
(3,609 Views)