12-11-2008 01:05 AM
Hiya folks,
I'm unfortunately stuck with making enhancements to a dinosaur application in LV 6i and am running into a strange issue I can't wrap my head around.
I have a VI that takes as input a single reference to an array of strict-type clusters. I would like to access the control references of each control in each element of that array. Using the standard (or what I believe to be the standard) VI server approach to breaking this down, I am able to get down to a single element of the array, cast it to a strict-type cluster reference, finally exposing an array of control references via a property node (see the attached image). This is all fine and dandy until I attempt to access that array of control references. So, referring to the image, the upper thread yields no error in "error out", however the scenario in the lower thread does.
If I attempt to access ANY other property in that final property node that has nothing to do with references, then everything works great.
Anybody have any ideas? Suggestions? Is the fact that these clusters are strict type def that's preventing me from moving forward (the only scenario I have not tested as of yet)?
12-11-2008 01:30 AM
I am not aware that writing to a "index vals" property sets the "focus" to a certain element of an array. I thought that property just determines which element is scrolled on the upper left corner of the array control/indicator. What makes you think otherwise?
I have a hard time to figure out what you actually want to do. Can you attach a simplified version of your VI to make it more obvious. Thanks.
12-11-2008 08:08 AM
Thank you for your response.
Setting the index value actually does work. If I want to access some property other than "Controls[]" ("Value" for example) then everything works great; changing the focussed index value spits out the correct index in "Value".
Ultimately, I'm working with a subVI that's attempting to dynamically manipulate the Datasocket properties of each control, in each cluster, in each element of that array. The number of elements is arbitrary.
I will attach an example later this morning - which will also aid in the troubleshooting of this thing.
Thanks!
12-11-2008 08:31 AM
My Nugget on Exploiting Control references should be useful. The attached VIs will too new for you to use but I beilve I posted screen shots of everything. The one limitaion that I can warn you about that will prevent you from duplicating those techniques in LV 6i is how I handled Clusters of arrays, of clusters or arrays.... etc. LV 8 or there-abouts added the ability to do complex recursive calls (A cals B that calls A...) But you shouldbe able to code around that detail or ignore it completely if your data structure will never be that complex. Here is a preview of what you will find in that Nugget.
Just trying to help,
Ben
12-11-2008 09:10 AM
12-11-2008 10:38 AM
Modifying properties of elements in an array is useless
Yes, I probably should have re-emphasized that this approach wasn't going to be useful (enough) for what I ultimately wanted to accomplish. However, that doesn't take away from the fact that I should still be able to access the reference of an individual control, embedded in a cluster that acts as an array element...... no? (whew, wordy....)
Ben, thanks for the reference to your nugget - there's some good information here.
Back to the drawing board! Thanks all for the responses.
12-11-2008 11:10 AM