LabVIEW and Visual Basic
Table of Contents
Introduction
The LabVIEW graphical programming environment not only excels in acquiring, analyzing, and presenting data but also in developing applications beyond measurement and automation. LabVIEW’s language is both robust and general purpose, which allows it to be used for a wide range of solutions. This paper is intended for Visual Basic developers who are interested in learning more about LabVIEW. It is also of interest to those who would like to see, through examples, how similar tasks can be accomplished in the two languages. The following three examples illustrate concepts such as the user interface, file I/O, event handling, loops, data structures, and interoperability with shared code libraries.
Example 1: Generate and Sort Numbers
In this first example, we illustrate the implementation of algorithms to generate a set of data points and then sort them in both Visual Basic and LabVIEW. Because of its familiarity and relative ease of implementation, Bubble Sort was selected. Please refer to the included code for a description of the algorithm. As with all of the examples in this document, the GUIs, which are known as front panels in LabVIEW, have been designed to be nearly identical in both environments.

See Also:
LabVIEW and Visual Basic - Example 1: Generating and Sorting Numbers
Generating and Sorting Numbers
Example 2: The Teacher's Assistant
In the second example, we illustrate how a professor might create a fairly simple program to keep track of students’ grades. This example expands on the first example by introducing the concepts of file I/O as well as LabVIEW clusters, which are similar to types in Visual Basic.

[+] Enlarge Image
See Also:
LabVIEW and Visual Basic - Example 2: The Teacher's Assistant
The Teacher's Assistant
Example 3: Sharing Code
While some programming projects begin with a blank slate, many others would be greatly expedited if existing code could be reused. This is especially true when the new solution is to be developed in a different environment. This is not to say that it is necessary to develop components of a LabVIEW application in another language. LabVIEW is a rich language that is designed for rapid development and can be used to create an application from the ground up. Example 3 illustrates how to call LabVIEW shared libraries from Visual Basic and also how to call Visual Basic libraries from within LabVIEW.

[+] Enlarge Image
See Also:
LabVIEW and Visual Basic - Example 3: Sharing Code with Visual Basic
Sharing Code with Visual Basic
Conclusion
Through these three examples, you have seen that LabVIEW is extremely useful and intuitive as a general programming environment. LabVIEW is also suited for projects that involve automation and/or the acquisition, analysis, and presentation of data via instrument control or DAQ devices. For more information on how LabVIEW can be used for these purposes, please refer to the links below. LabVIEW’s capabilities are continually expanding. Applications can be targeted to run on PDAs, FPGAs, and across operating systems such as UNIX, Linux, Mac OS, and real-time systems.
In addition, the NI Developer Zone is a forum where a large community of LabVIEW developers collaborate to assist one another in their endeavors, posts examples, shares successes, and seek support from National Instruments Applications Engineers.
All of the code for each example in this document is available for download and is linked both below and from within each section. The Example 3 .zip archive also includes all of the code used to build the DLL files that were called from each environment.
Related Links:
NI Developer Zone
NI LabVIEW Zone
LabVIEW Demonstrations
Download a Fully Functional Evaluation Copy of LabVIEW
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial 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 content with each new revision of related products and drivers. THIS TUTORIAL 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/).
