03-21-2009 06:16 AM
Hi,
I have built an array of references in one way.... and it was useful.
but, when I needed the array to contain different types of control, and use this array in a different VI, the array refuses to accept any property node,
so I have used some example I found to build the array differently, and now that works fine.
can anyone tell me the best way to build an array of references.
the example I found makes me to choose the variable names carefully,
is there a better way ?
see the PDF attached
and the VI attached
thanks,
Amitai Abramson
03-21-2009 11:49 AM
If you want to e.g. select all references of numerics, you could filter based on the property "classname" or "classID".
03-21-2009 04:55 PM
Hi Altenbach,
you were helping me a lot today,
You are right, I can use the second method (shown in my attachments) to build the array of references
and differentiate one from another with the class property.
is it the same way you use to build an array of references ?
are you familiar with another method to create an array of references ?
(or a cluster of references ?)
Amitai Abramson.
03-22-2009 10:49 AM
Amitai Abramson wrote:is it the same way you use to build an array of references ?
are you familiar with another method to create an array of references ?
(or a cluster of references ?)
Frankly, I have never had the need to built such arrays of references. What exactly are you trying to do with it? Maybe there is a better solution for your programming problems?
In any case, stick with arrays. The uses of clusters for this seems wrong.
03-22-2009 12:57 PM
I don't know exactly what you are trying to do, but....
In the upper part of your PDF, notice the coercion dots. Both the NUMERIC and STRING references are being coerced to another type (probably generic control references), that means that you can't use the array as anything but generic control references.
I suggest you tell us what you are trying to accomplish.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
03-22-2009 01:21 PM
Alternative way:
Use a type cast to the type you need and catch the error.(wire to the selector of case structure). In the no error code, append it to the array.
That way, you will get it in the array whenever the type cast bis possible. Using class ID would be only the intended type.
Which to prefer depends on the use case.
Felix
03-22-2009 01:51 PM
Hi you all,
Thank you for your suggestions,
Felix, this is a creative Idea, but I think I will stick with the conventional way of an array,
What am I trying to accomplish ?
I am trying to create a simulator to some military device,
and I need it to look as similar as possible to the original user-interface of the device.
Thank you all for your help.
Amitai Abramson.