Calling LabVIEW DLL in Visual C++ That Passes Array Handles by Reference
Overview
This example demonstrates the syntax necessary for passing array handles between an external coding environment and a shared library (DLL) you create in LabVIEW.
Downloads
Filename: array_handle_passing.zip
Requirements: View
The Call Array_Multiply DLL folder contains the files for the workspace of the same name, as well as the Array_Multiply.dll. The main code of the project allocates memory for the handle pointers and initializes the arrays to which they point.
Note: To make the example as simple as possible, each array contains only one element.
Print statements write the value of the first element of the output array to a console before and after a call to the shared library. You will see that the call to the shared library changes the value of the output array.
Note: You might need to reattach labview.lib to the project. You can find this file in the labview\cintools directory.
Requirements
Filename: array_handle_passing.zip
Software Requirements
Application Software: LabVIEW Full Development System 7.0
Language(s): C++, LabVIEW
Additional Software: Visual C++ 6.0
Reader Comments | Submit a comment »
Hi,
I would really like to have such an example
in c#?
Rgds,
David
- Mar 16, 2012
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
