LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Management for Large Arrays


@altenbach wrote:

Here is a quick attempt at a variant version. The order ouf the output is different, but that might not matter. The entries are still correctly matched to the values. If it matters, a few things need to change.

Of course you would carry the data inside the variant across caller and subVIs, etc. There is not need to extract the actual data until you save.

 


Ok, so while implementing this method in one of the functions, I came across a situation when I have to compare the values (rows) of one 2D array with those of another 2D array.

I am converting all the combinations of String arrays and corresponding U8 2D arrays into variants. But since I cannot search "values" of attributes in a variant, I have to fetch their String and Values array sets (Variant to Data).

I have used the example you described, but the values are now a 2D array, unlike the 1D T(val) out in that example. And the problem arises in fetching those row values from the variant. The Variant gives output values as 1D variant array, but my desired output of the values is a 2D numeric array. 

2D Array Rows_Variant.png

I could not fetch the 2D Array data from the variant attribute values. Instead I tried for 1D array and it worked (just to see how the order of the Str elements changed).

But in order to perform the operation I need (two U8 2D arrays, and searching if rows of one of the arrays are there in the other one), I cannot work with variant because variant gives data by the name of their attributes only, not the attribute by the values (of course, that doesn't make sense, but even if I can find the first non-matching row and its corresponding attribute name, that's enough).

2D Array to search.png

The row index output in the above program is used to fetch the corresponding string from a string array (which I am planning to use as variant attribute).

 

For all the other operations, Variant option is very good, performance wise. So I have decided to go for it. But this particular functionality has encountered a road block, and I might have to stick to the arrays if I cannot "either fetch back the 2D array from Variant values, or find a way to compare attribute values of two variants".

 

Thanks ahead!

 

Vaibhav
0 Kudos
Message 41 of 41
(476 Views)