LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pass array reference

Hi All,
I have a question regarding array refnum :
in my main vi i have an array of strings that i want to pass to a sub-vi.
so i created an array reference in the main vi and pass it to the sub-vi.
in the sub-vi i created a control(array) refnum that receive the array from the main vi.
Now (in the sub vi) i want to check the array size but i have miss type problem (array refnum <=> 1-D array) .
 
How do i receive the 1-D array property from the array refnum in the sub vi ??
 
 
Thanks,
 Asaf
0 Kudos
Message 1 of 5
(3,178 Views)
Hello asaf,

why do you use a reference? Just use a normal control in your subVi connected to a terminal in the connector pattern!


Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(3,172 Views)
Hi,
This is because i want the changes i make to this array will affect the array in the main vi .
0 Kudos
Message 3 of 5
(3,169 Views)
You can use Property Node to get VALUE property.

As the reference is of an array, it doesn't know the Type of the array, so Value is Variant.

As you do know the type of the array, you can convert Variant to the type you want (string array) with 'Variant to Data' in Communications -> ActiveX palette.

This way you have the same array as the one you pass by reference. You can check array size or whatever you do with your original array.

Hope it helps,

Aitortxo
Aitortxo.
0 Kudos
Message 4 of 5
(3,165 Views)
Hello asaf,

well: get it back the same way and wire it to a local. Or use a shift register, if you have a loop in your main vi.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(3,163 Views)