Table Of Contents

Language Integration in LabVIEW

Last Modified: July 16, 2018

You can use multiple programming languages to develop your application. How you integrate pieces of code written in different languages into your overall application depends on the language and the target you are integrating the code into. Use the tables below to compare the languages that are native to LabVIEW and the external languages that you can integrate into LabVIEW code.

The following table provides integration details for each language in LabVIEW.

Graphical Language Integration Details
G

You can call a VI from the following source documents:

  • Host VI—Create a subVI node by dragging the VI from the Project Files tab onto the diagram.
  • FPGA VI—Create a subVI node by dragging the VI from the Project Files tab onto the diagram.

You can also configure an FPGA VI as an Optimized FPGA VI to use G algorithms on an FPGA. Configuring the VI as an Optimized FPGA VI enables additional features, but also limits the palette to nodes and data types supported on an FPGA. When you drag an Optimized FPGA VI from the Software palette category onto the diagram, LabVIEW encloses the Optimized FPGA VI in an integration node.

You can call an optimized FPGA VI from the following source documents:

  • Host VI—Use an Optimized FPGA VI in an integration node to simulate your code before moving it to an FPGA.
  • FPGA VI—Use an Optimized FPGA VI in an integration node only inside a Clock-Driven Loop.
  • Multirate Diagram—Use an Optimized FPGA VI in an integration node.
  • Optimized FPGA VI—Create a subVI node by dragging the Optimized FPGA VI from the Project Files tab onto the diagram.
Multirate Dataflow

When you drag a Multirate diagram from the Source Code palette category onto the diagram, LabVIEW encloses the Multirate diagram in an integration node.

You can call a Multirate diagram from the following source documents:

  • Host VI—Use a Multirate diagram node to simulate your code before moving it to an FPGA.
  • FPGA VI—Use a Multirate diagram node only outside of a Clock-Driven Loop. Pass data between a Multirate diagram and the code inside a Clock-Driven Loop using FIFO references.
  • Multirate diagram—Create a subMRD node by dragging the Multirate diagram from the Project Files tab onto the diagram.
Clock-Driven Logic

You can call Clock-Driven Logic from the following source documents:

  • FPGA VI—Add Clock-Driven Logic directly to the diagram inside a Clock-Driven Loop, or create a subCDL node by dragging the Clock-Driven Logic document from the Project Files tab into a Clock-Driven Loop.
  • Clock-Driven Logic document—Create a subCDL node by dragging the Clock-Driven Logic document from the Project Files tab onto the diagram.
C

You can integrate C code only into a host VI. Use a C Node to import existing C code into your application or to develop your application using C functionality.

The following table provides integration details for each external language interface.

External Language Interface Integration Details
Shared Library Interface An SLI connects your G Dataflow application to a shared library which contains executable programming modules written in another programming language.

Use an SLI in your application to create entry points, or defined calls, to these portions of external code. Visual representations of entry points appear on the software palette on the diagram. You can place and wire entry points like nodes.

As the application executes, the SLI calls the function in the external code. Input data passes from the diagram to the external code, and data returns from the external code to the diagram.

Interface for MATLAB

An Interface for MATLAB (.mli) is a document in which you define calls to a MATLAB file (.m or .mlx) in your G dataflow application.

In an Interface for MATLAB, you create interface nodes that map to arguments in a MATLAB function or variables in a MATLAB script. Visual representations of interface nodes appear on the Project Item»Software palette on the diagram. You can place and wire interface nodes in your application.

When you execute the application, the Interface for MATLAB invokes MATLAB, which calls the MATLAB file. Input data passes from the diagram to MATLAB, and data returns from MATLAB to the diagram.

spd-note-note
Note  

You must target documents to the same location before you can call a document from another document. For example, a host VI can only call other documents targeted to the host, and an FPGA VI can only call other documents targeted to the same FPGA.


Recently Viewed Topics