12-15-2016 05:04 PM
Hello,
I've got to call a function from a C# library which has a function parameter of the type int[][].
Up to now I could not find a way to create such an object in LabVIEW so that it is accepted.
C#:
public MyClass(int[][] parameter)
Is there a way in LabVIEW to create a jagged array?
Have a nice day
Michael
12-19-2016 03:11 AM
Hello Michael,
unfortunately LabVIEW does not support arrays of arrays. Therefore, you'll not be able to use a jagged C# array directly. My knowledge of C# is limited but would it be possible to split the arrays before passing to LabVIEW using a wrapper?
Kind regards
Andreas
12-19-2016 03:35 AM
Hi Andreas,
what I did now was to create a factory class in C# for which a have a function
addArray1d()
which is called several times from LabVIEW and creates within C# the jagged array.
Then I call the
createObject() function which internally passes the now hidden jagged array to the constructor of the class and then returns the object which I can use in LabVEW. It is a workaround which is not very pretty - but it works.
Have a nice day
Michael
12-19-2016 05:04 AM
If it works it's pretty. 😉
/Y