LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I build, then pass back an array of strings in a CVI DLL to Labview?

CVI doesn't recognize the SetCINArraySize symbols from the labview.lib when you include the extcode.h

So..how do I pass a zeroed array of strings from Labview into a CVI DLL, populate that array and pass it back?

Kindest,
Warren
0 Kudos
Message 1 of 4
(2,554 Views)
Since LabVIEW manages its own data in the background, one needs to be careful while modifying the memory allocated for these data variables. One such case is when we resize the length or Arrays of Strings passed from LabVIEW to a DLL or CIN. To avoid any illegal access of memory in such instances, LabVIEW provides special memory management functions. More information on these functions and their usage is documented in 'LabVIEW Code Interface Reference Manual'.
The attached example shows how you can use CIN Memory Management functions to manipulate the Arrays and Strings passed from LabVIEW to DLL. The DLL is built using LabWindows/CVI 5.5, but the same functions can be used in other compilers like Visual C/C++ or Visual Basic.

Marc
Message 2 of 4
(2,554 Views)
Hi Jeff,

This example makes things a bit clearer. Although its a bit confusing to resize the string array with a function called numericArrayResize().

Kindest,
Warren
0 Kudos
Message 3 of 4
(2,554 Views)
Jeff, Can you point me towards an example that shows
how to send a pointer to an array created in a CVI DLL
to LV6i. Also, what is the difference (advantages, or
disadvantages) of sending a 'handle' to this array.
The array is large (1024x1024xdouble) - which is why I
want to pass this by reference.

Thanks in advance!

-Martin
0 Kudos
Message 4 of 4
(2,554 Views)