In addition to importing source code to a LabVIEW block diagram, you can reuse existing applications and algorithms developed in other languages by calling them from a LabVIEW application. For instance, if you have an existing C/C++ shared library and need to reuse it in LabVIEW, you can call it using the Call Library Function Node. To make importing external libraries simple, LabVIEW includes the Import Shared Library Wizard, which automatically creates or updates a LabVIEW wrapper VI project library for incorporation into a LabVIEW block diagram.
Figure 1. Use the Call Library Function Node to reuse existing C or C++ shared libraries in-line with G programming.
Call MATLAB scripts you have developed in The MathWorks, Inc. MATLAB® software, which includes common programming approaches for numeric analysis, signal processing, and advanced mathematics. By combining them in a VI with G using the MATLAB Script Node, you can integrate your test and measurement system with MATLAB analysis capabilities.
LabVIEW can also call into other applications running in the system. Over the past 10 years, Python has grown in popularity and expanded to offer hundreds of thousands of libraries for a wide spectrum of applications. Developing Python automation scripts for incorporation into a larger LabVIEW umbrella is an intuitive solution that merges the flexible scripting capabilities of Python with the system design tools in LabVIEW. There are multiple ways to reuse Python code including the Python Integration Toolkit for LabVIEW by Enthought or interfacing with the command-line from within LabVIEW, which provides OS-specific interfaces for calling executables and other build libraries.
Figure 3. Reuse existing Python scripts in LabVIEW by calling them inline using the Python Integration Toolkit for LabVIEW.
LabVIEW has both general and industry-specific peripheral communications libraries for Ethernet and serial-based communications. With native support for common industrial protocols such as CAN, PROFINET, OPC UA, and EtherCAT, LabVIEW can connect to a variety of devices, equipment, and infrastructure. If you have a brownfield application that requires support for many protocols, LabVIEW can act as a gateway translating between any of the nearly 20 supported protocols, including industry-specific protocols such as DNP3 and FlexRay.
With access in LabVIEW to program an FPGA, you can even efficiently build custom communication protocols for legacy or proprietary communication needs. The LabVIEW FPGA Module includes digital bus protocol code examples as starting points such as serial, I2C, and SPI to build on top of as well as FPGA IP core for high-speed serial protocols such as Xilinx Aurora, Serial RapidIO, JESD204B, and 10 Gigabit Ethernet.
Figure 4. Communicate with DUTs and other system components using standard protocol support in LabVIEW, like the NI-XNET instrument driver.