LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get the address of a LV array?

Hi!

I try to pass a 1D array of ShortInt to an external DLL. I found many solutions for C DLLs (using the Call Library Function Node) but this doesn' work for my COM / ActiveX DLL. The external function expects a simple integer value as reference pointer to an array. The array is created in LV and will not be resized by the external function.

Any ideas how I can get the address of my array, send this pointer to the DLL and get my array filled with data that way? I tried typecasts (array => int) but they don't work that way.

Thanks!
0 Kudos
Message 1 of 4
(2,943 Views)
hi there,
 
you can use following controls from the controls palette for COMing or ActiveXing:
 
COM: "refnum"->"Automation Refnum"      right click "Select Active X Class"
AX:     "Containers"->"Active X Container"  right click "Insert ActiveX Object"
 
refer to "Windows Connectivity"->"ActiveX" from the "VI, functions and How-To" LabVIEW Online help.
 
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 4
(2,923 Views)
The problem is not accessing the COM-DLL. This works fine. The DLL I have handles a datafile, I can access different integer and string-fields with the COM DLL, the only thing that doesn't work is getting data from the file into an array. The DLL-Method expects an pointer that points to an already initialised array.

The Call Library Function Node automatically passes the address of a connected array as a pointer, how can I do that with a COM-DLL?

***

Here's the documentation of the function I want to use:

virtual long CMCSAStream::GetRawDataOfChannel(short *pData,long lIndex) [virtual]


Get raw data of a single channel.

Parameters:
pData pointer to data array of shorts (size must be determined before calling GetData.
iIndex: index to channel (starts with zero!)

Returns:
number of Data values read from the file, 0 if data is not a raw data stream
0 Kudos
Message 3 of 4
(2,898 Views)

Hi M.C.

Did you try to just wire your array to the Call DLL function input, configure the input for array and

array format to pointer ?

0 Kudos
Message 4 of 4
(2,855 Views)