Integrate Existing Source Code and Shared Libraries Into LabVIEW
LabVIEW includes numerous options to reuse your existing code base so you don’t have to reinvest.
Integrate .m Code
Import, edit, and execute the .m files you have developed in The MathWorks, Inc. MATLAB® or GNU Octave software, which are common programming approaches for numeric analysis, signal processing, and advanced mathematics. By combining them in a VI with G, you can build these scripts into stand-alone executables that run on a desktop computer, as well as deterministic real-time hardware to rapidly gain access to real-world I/O.
Figure 1. The MathScript Node makes it easy to interface G programming and real-world I/O with .m scripts.
Integrate C Code
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 2. Use the Call Library Function Node to reuse existing C or C++ shared libraries in-line with G programming.
Integrate Python, ActiveX, and .NET Code
LabVIEW can also call into other applications running in the system. 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. Interfacing with the command-line is also possible with the System Exec.vi, which provides OS-specific interfaces for calling executables and other build libraries. LabVIEW can also call external code exposed through ActiveX or .NET interfaces.
Integrate Packages From the Linux Community
As the NI platform itself is built on many standard technologies, LabVIEW users can expand the amount of reuse their team does with access to other technology ecosystems, including the use of Linux-based libraries in and alongside their LabVIEW Real-Time applications.
These methods use existing code so development teams can reuse as much code as possible and integrate it into their test, measurement and control systems.
Integrate VHDL Code
You can use the LabVIEW FPGA Module to write code that runs on an FPGA using G. However, as with the previous programming approaches, you might want to reuse existing code or have the flexibility to choose the means of implementation. Most FPGAs are programmed using VHDL, a text-based dataflow description language. Instead of rewriting existing intellectual property (IP) from VHDL in G, you can import the VHDL into your VI using the Component-Level IP (CLIP) Node.
Interoperability for Team Collaboration
Efficiently design your system in a collaborative environment with LabVIEW by embracing your team’s software language competencies to complete the task with the right tool. LabVIEW provides interfaces for different team members working in different environments to productively collaborate.
Communicate With External Systems Through Standard Industrial Protocols
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 numerous 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. LabVIEW FPGA 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.
Developing C/C++ Applications
Many teams have existing, familiar development environments and toolchains that can coexist and interoperate with LabVIEW-built systems. For example, for the NI Linux Real-Time targets, developers can develop, debug, and deploy applications to the embedded processor written entirely in C or C++ using Eclipse or another preferred integrated development environment (IDE) and interface with LabVIEW applications.
Figure 3. Program the embedded processor with LabVIEW or any Linux-compatible tools and use the NI reconfigurable I/O (RIO) driver to communicate with LabVIEW FPGA.
Simulating and Modeling Physical Systems
Modeling and physical system simulation are often used in the design of embedded systems. You can test your monitoring or control code written in LabVIEW in conjunction with a physical system simulation. Or, you can compare your test and measurement results with a model running in LabVIEW. With the graphical signal flow capabilities of the LabVIEW Control Design and Simulation Module, you can create and analyze models to learn about dynamic system characteristics and also create a control system that achieves wanted behavior. As shown in Figure 4, you can combine a model-based programming approach with other methods, including G and the MathScript Node.
You can also use the Simulation Model Converter to help convert your models developed in The MathWorks, Inc. Simulink® software to work with LabVIEW. These dynamic systems can be deployed to real-time hardware targets without any intermediate steps thanks to the LabVIEW Real-Time Module, which is well-suited for rapid-control prototyping and hardware-in-the-loop applications. If you want to keep your model development in the Simulink environment or a variety of other simulation environments, you can use the LabVIEW Model Interface Toolkit to interface with LabVIEW and LabVIEW Real-Time.
Figure 4. Import control algorithms and system models from LabVIEW and third-party modeling environments.
Many users use LabVIEW as the glue of an overall system because of the flexibility to incorporate different subsystems together as teams collaborate to reuse existing code and software competencies, and plan for the future. To augment your productivity, NI has assembled over the last 30 years a large ecosystem of LabVIEW code, tools, and partners to help you successfully build your test, measurement, and control systems faster.
MATLAB® and Simulink® are registered trademarks of The MathWorks, Inc. The registered trademark Linux® is used pursuant to a sublicense from LMI, the exclusive licensee of Linus Torvalds, owner of the mark on a worldwide basis.