Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Aug 19, 2008

Calling a C-built DLL in LabVIEW to Generate and Sort an Array of Numbers

9 ratings | 3.11 out of 5
Print

Downloads

Filename: call_c_dll_in_lvnew.zip
Requirements: View

This example is designed to illustrate the concept of using external code in LabVIEW. Specifically, this example demonstrates that LabVIEW allows a developer to use the code developed external to LabVIEW. This example contains a LabVIEW program that generates and sorts an array of numbers by calling a C-built DLL using LabVIEW's Call Library Function Node. This example also contains the C source code that the DLL was built from. It contains a .c file and a .prj file that can be build in LabWindows/CVI, as well as a .cpp file and all of the project files necessary to build this in Microsoft Visual C++. If you see a broken arrow when you open the LabVIEW VI, double-click on the Call Library Function Node and relink to the exact path of the DLL.

This example was written in conjunction with the "Can LabVIEW C? - Example 3: Using the Right Tools with LabVIEW" document linked below, which compares C and LabVIEW's functionality.

Requirements:

  • LabVIEW 8.0 or later or LabVIEW Evaluation Software is required to view and run the LabVIEW examples.
  • Any C compiler is required to view and execute the C code. If you do not have a C compiler, you can download the LabWindows/CVI Evaluation Software to run the C code and to try the premium C environment for measurement and automation applications. At a minimum, the LabWindows/CVI Run Time Engine is required to run the CVI executable.
Related Links:
Evaluate LabVIEW online, download LabVIEW evaluation software, or request a LabVIEW DVD trial version.
LabWindows/CVI Evaluation Software
LabWindows/CVI Run Time Engine
Can LabVIEW C? - Example 3: Using the Right Tools with LabVIEW
Can LabVIEW C? Overview Whitepaper

 

Requirements


Filename: call_c_dll_in_lvnew.zip

Software Requirements


Application Software: LabVIEW Professional Development System 8.0
Language(s): LabVIEW, C
Additional Software: Visual C++

 
9 ratings | 3.11 out of 5
Print

Reader Comments | Submit a comment »

Clear and easy DLL code!
- W Bortel, Bortel COntrolls. wjbortel@pi.net - Apr 17, 2004

 

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/).