导航菜单
首页 >  LabVIEW Call Matlab m file 20220119  > Using Python, MathWorks® MATLAB® Software, and C/C++ with LabVIEW

Using Python, MathWorks® MATLAB® Software, and C/C++ with LabVIEW

Over the years, Python has grown in popularity and expanded to offer hundreds of thousands of libraries for a wide spectrum of applications. Incorporating Python into LabVIEW merges the flexible scripting capabilities of Python with the system design tools in LabVIEW.

With the Python Node, LabVIEW provides a native ability to call a Python script from a LabVIEW Block Diagram. This feature allows for interoperability between the languages with low latency.

Figure 1: Integrate Python scripts in LabVIEW by calling them with Python Node.

In the Python Node, you can specify which version to use and the path to Python when calling functions, which allows access to Python installed in custom directories. This capability means that you can use multiple Python Nodes to open multiple sessions of different versions or executables stored in custom directories.

LabVIEW 2022 Q3 added support for passing Python class objects as parameters. The refnum output on the Python Node represents a Python class object, which you can then pass as an input to another Python Node to act on the class object.

.

Figure 2: LabVIEW 2022 supports passing of Python class objects as parameters.

LabVIEW 2023 Q1 adds a new function for calling Python virtual environments with Anaconda and Venv.

NI is continuously investing in improving the Python-LabVIEW interoperability, with updates planned through 2023 and beyond. You can learn more about what’s new in LabVIEW and our future plans on our LabVIEW overview page.

相关推荐: