LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Any better way to generate a reference?

Solved!
Go to solution

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

0 Kudos
Message 1 of 7
(3,271 Views)

Post the VI in LV 8.6....

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 7
(3,269 Views)

**************************!!! PLEASE DON'T POST VIs SET TO "RUN WHEN OPENED !!! **************************

 

Don't overcomplicate things! Why would you need references? 😮

 

Try this.

0 Kudos
Message 3 of 7
(3,256 Views)

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.

0 Kudos
Message 4 of 7
(3,227 Views)
Solution
Accepted by topic author bracker

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.

0 Kudos
Message 5 of 7
(3,190 Views)

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

0 Kudos
Message 6 of 7
(3,178 Views)

Thanks pcardinale.  I see that my double autoindexing was somewhat redundant.

 

0 Kudos
Message 7 of 7
(3,163 Views)