LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

datatype-independent array-operations

Hello,

I have the following problem:

I use many forms of arrays (of different datatypes) in my program. Often I wanrt to overwrite the element with index i. But to do this, this index must "exist" / must be initialised. When the index doesn't exist, nothing changes.
I want to write a VI that replaces the value at the index i (if the index is initialised) or appends the value at the end of the array (if the index wasn't initialised). But I don't want to write this VI for every datatype I use (for example arrays of arrays or orrays of structs).
Is there a possibility to write a datatype-independent VI?

Thanks
0 Kudos
Message 1 of 2
(2,550 Views)
Hi Thomas,
yes; it's possible to write vis which adapt to the input datatype. This is called 'polymorphic vis'. You have to create a vi for each datatype and 'bind' these vis into one polymorphic vi.

But:
It seems more promising to overthink your array handling! Why do you write to non-initialized array indices?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 2
(2,547 Views)