From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Array from C# to LABVIEW SharedDLL

Hello,

I have written a LabVIEW SharedDLL with the following signature:

 

void CurveFitting(char Input[], DoubleArray ResultArray, DoubleArray1 OutputArray)

CFArrayDll_Properties.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I'm trying to call this Function from C# but I guess I'm not using the right notation for passing an array from C# to LabVIEW. The first argument Input is a filename, the remaining two are arrays into which LabVIEW is to write the results.

 

This is the C# code to declare the DLL...

[DllImport("CFArray.dll")]
unsafe static extern void CurveFitting(string Input, out double dResultArray, out double dOutputArray);

... and this is how I'm calling it (unsuccessfully though)

private void btnCurveFit_Click(object sender, EventArgs e)
{           
            CurveFitting(txtFilePath.Text,  ResultArray, OutputArray);
}

Help is deeply appreciated! Thanks.

0 Kudos
Message 1 of 1
(2,005 Views)