04-13-2023 10:42 PM
Hi,
I have an array of clusters that i'm indexing using array refnum, ArrElem and IndexVals to obtain each element and process it as a Cluster in a different loop. The problem that i have is that every time that a new array element is indexed, it will overwrite the previous one because is the same refnum.
I'm attaching a simpler VI that is doing the same process but with an array of strings (which is the same case is terms of references).
Question:
How can i assign or modify a control refnum (in hex) value on each element of an array to make each element unique by reference?
Thank you in advance,
Note 1: If it is possible to do this within Labview, that will be perfect, but i have spent already several days trying to find how to do this, and it seems that I will need to use an external language or go deep into the labview configuration to do this.
Note 2: This is a very very very simple example of a very very very huge project for which i'm creating a generic indexing (because i don't know what will be my array), so what i need is to have each element of the array with its unique reference so that i can process each element at anytime later.
Before
After
04-14-2023 12:38 AM
Hi,
why don't you use the array functions instead of reference, it seems the property you are trying to use is not settable when vi is running?
04-14-2023 02:03 AM
What are you really trying to achieve here?
If you want an array of 'anything', either make it an array of Variants, or of classes. It'll require (quite) some outside code for handling, probably, but that's the nature of the beast. If you want some functions that work on any type of array, just make it a Malleable VI (it can't be dynamically anything with them, but at coding/compile time)
So, what are you trying to achieve?
04-14-2023 02:40 AM - edited 04-14-2023 02:48 AM
@JATB wrote:Question:
How can i assign or modify a control refnum (in hex) value on each element of an array to make each element unique by reference?
If that would work, it would work like this:
Note that values are not 'hex' or 'decimal'. Hex or decimal are how you visualize the values, it doesn't change the value.
You basically don't want to work with arrays like that.
Array indices don't have references that work like that. The properties of index would change all other indices's properties, as there is just 1 type in the array (all values are the same). It doesn't serve any purpose to do this.
In stead, use values and indices:
04-14-2023 12:39 PM
The array element reference refers to one array element; and you don't get to pick which one. Usually it's the last one that had text focus.
04-14-2023 12:46 PM
Sometimes this works, but it doesn't seem to be reliable.