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: 

How to use the interface in the form of array handle to make DLL files for LabVIEW

I need to develop a DLL file for LabVIEW project, written in C++.  The array interface of DLL needs to adapt to the array format of "array handle" in LabVIEW "calling library function node".

 

According to the official description, "data handle" corresponds to the secondary pointer(**) in C language, but how to create a data format in the secondary pointer that conforms to the calling rules of LabVIEW "calling library function node", so as to transfer a one-dimensional / two-dimensional array? Is there any official DLL development example?

 

Thanks for your teaching.

0 Kudos
Message 1 of 2
(569 Views)

Try to configure a Call Library Node with the parameter supposed to pass the array configured as Adapt to Type, connect your array to it and now comes the neat trick: Right click on the Call Library Node and select “create C code” and in the file dialog enter a file name and location to save that C file. 

LabVIEW will creat a C file with an empty function that has the correct parameter definitions for the function as configured in the Call Library Node at that moment.

 

The rest is understanding C programming which you of course do or you wouldn’t try this, would you?

 

if you need to allocate, resize or deallocate such a handle in your code you MUST use the LabVIEW exported memory management functions for that!

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(543 Views)