12-21-2010 10:32 PM
I am autoindexing through an array of cluster controls to work with their values. At the same time though, I want to update the value of the front panel control if a certain boolean is selected. Therefore, I also autoindex through references to the cluster in the same FOR loop (see attached VI). This works, but it seems a little error prone, not to mention tedious if I have many clusters index through. Is there a better way to do this? I hoped I could generate a reference from the cluster wire inside the FOR loop, but I suspect this isn't possible, because the wire may represent a copy of the FP values rather than the FP control itself.
Thanks,
Allan
Solved! Go to Solution.
12-21-2010 10:41 PM
Post the VI in LV 8.6....
12-22-2010 12:38 AM - edited 12-22-2010 12:46 AM
**************************!!! PLEASE DON'T POST VIs SET TO "RUN WHEN OPENED !!! **************************
Don't overcomplicate things! Why would you need references? 😮
Try this.
12-22-2010 10:25 AM
I was too specific in the simplified example I provided--in general, I would also want to change properties other than "value", so I think I would still need references and property nodes. In that case, would I still need need to separately autoindex the references?
Your example raises another question for me as well, because you replaced my individually-named clusters with an array of a clusters. It appears that this was essential in order to have a single front panel control that can generate events. But if I only have an array of clusters, my clusters no longer have independent names that make them easy to keep track of in my program. I will eventually have something like 20 clusters to keep track of, and they will not all be treated identically in other parts of my program, so I think I really need the self-documenting nature of clusters. It's for this reason I kept them separate and had a "build array" outside the "for" loop. If necessary I could build a big cluster of the small clusters that could generate events, and then convert cluster-to-array for the "for" loop. Is there a better way?
Sorry about the auto-run VI. I didn't know it was that way or that there even was such an option.
I only have Labview 2009-10, so I can't post other versions.
Thanks.
12-22-2010 04:27 PM
You don't need to autoindex both.
You can't get a reference from the cluster wire, but you can go the other way: get the cluster data from the reference using the 'Value' property. See attachment.
12-22-2010 06:17 PM
You can save as "other versions" right from the file save as options. It is really handy to be able to do this as you might miss out on some really good help , by not.
Alan
12-22-2010 09:55 PM
Thanks pcardinale. I see that my double autoindexing was somewhat redundant.