08-03-2016 09:18 AM
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
08-03-2016 09:48 AM
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.
08-03-2016 09:58 AM - edited 08-03-2016 10:00 AM
08-03-2016 10:05 AM
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
08-03-2016 10:07 AM
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
08-03-2016 12:06 PM
Maybe a Functional Global will do here?
08-04-2016 05:54 PM
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
08-04-2016 08:04 PM
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.
08-04-2016 09:56 PM - edited 08-04-2016 10:03 PM
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.
08-05-2016 04:37 AM - edited 08-05-2016 04:42 AM
@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.