I created the .NET library compiled by LabVIEW, which has a function that accepts an array of numbers and animation. This function will return an array in which each number is multiplied by the multiplicand. When a function is called in C #, it turns out that the function takes a nonzero indexed array ( double[*]) and intas parameters and returns another nonzero indexed array.
I can create a nonzero indexed array using the C # method Array.CreateInstance(). However, I cannot pass this array to a function since a data type is required double[*].
From Internet research, it seems that .NET does not support a non-zero indexed array type. I tried to find a way to modify the LabVIEW program to generate a function that takes a zero index without using.
Any tips on how I can get around this?
Update 1
LabVIEW Flowchart

C # program
const int Length = 5;
const int LowerBound = 1;
Array numbers = Array.CreateInstance(typeof(double), new int[] { Length }, new int[] { LowerBound });
for (int i = numbers.GetLowerBound(0); i <= numbers.GetUpperBound(0); i++)
{
numbers.SetValue(i, i);
}
var variable = LabVIEWExports.Multiply(numbers, 2);
Console.ReadKey();
LabVIEW Function Signature in C #

Update 2
Tried to use C # Reflection to call the LabVIEW function with the following codes, but to meet TargetInvocationException.
const int Length = 5;
const int LowerBound = 1;
const string methodName = "MultiplyArray";
const string path = @"C:\";
Array numbers = Array.CreateInstance(typeof(double), new int[] { Length }, new int[] { LowerBound });
for (int i = numbers.GetLowerBound(0); i <= numbers.GetUpperBound(0); i++)
{
numbers.SetValue(i, i);
}
Assembly asm = Assembly.LoadFile(path + "LabVIEW.Interop.dll");
Type type = asm.GetType("LabVIEW.Interop.LabVIEWInteropExports");
if (type != null)
{
MethodInfo methodInfo = type.GetMethod(methodName);
if (methodInfo != null)
{
object result = methodInfo.Invoke(methodInfo, new object[] { array, multiplicand });
}
}
Console.ReadKey();
Internal exception message
Unable to cast object of type 'System.Double[*]' to type 'System.Double[]'.
Internal exception stack trace
at NationalInstruments.LabVIEW.Interop.DataMarshal.InitMarshalArrayIn(IntPtr data, Array array, Marshal1DArray val)
at LabVIEW.Interop.LabVIEWInteropExports.MultiplyArray(Double[*] input__32Array, Int32 numeric)
It seems that at some point in the execution, the program tries to marshal the type double[*]on double[]using the function InitMarshalArrayIn()in the assembly that comes with LabVIEW.