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.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

DDC_GetNumDataValues shows error code 6202

Solved!
Go to solution

I am writing a wrapper in C# to read TDM files still.

But I met the error code 6202 using DDC_GetNumDataValues.

        [DllImport("nilibddc.dll", CallingConvention = CallingConvention.StdCall)]
        static extern int DDC_GetDataValues(IntPtr channel, ulong indexOfFirstValueToGet, ulong numberOfValuesToGet, IntPtr values);



IntPtr databuff = Marshal.AllocCoTaskMem((int)(sizeof(double) * numDataValues));
ret = DDC_GetDataValues(channels[i], 0, numDataValues, databuff);

Does Anyone know how to solve this error?

 

 

Thanks for any help.

0 Kudos
Message 1 of 2
(2,382 Views)
Solution
Accepted by topic author Takayama

I solved this issue myself.

I wronged the aggument's type.

[DllImport("nilibddc.dll")]
static extern int DDC_GetDataValues(IntPtr channel, uint indexOfFirstValueToGet, uint numberOfValuesToGet, IntPtr values);

IntPtr databuff = Marshal.AllocCoTaskMem((int)(sizeof(double) * numDataValues));
ret = DDC_GetDataValues(channels[i], (uint)0, (uint)numDataValues, databuff);

Thanks.

 

 

 

0 Kudos
Message 2 of 2
(2,356 Views)