LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to build an array of references?

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

Download All
0 Kudos
Message 1 of 7
(3,627 Views)

If you want to e.g. select all references of numerics, you could filter based on the property "classname" or "classID".

 

 

0 Kudos
Message 2 of 7
(3,604 Views)

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.

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

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.

Message 4 of 7
(3,567 Views)

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. 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 5 of 7
(3,552 Views)

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

Message 6 of 7
(3,550 Views)

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.

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