该内容不适用于您选择的语言

该内容将以另一种语言显示出来。 您可使用浏览器的翻译功能查看内容。

Executing Parallel Processes with the Python Node in LabVIEW

Updated Feb 9, 2024

Reported In

Software

  • LabVIEW 2018

Programming Language

  • Python

Issue Details

I am writing a LabVIEW application that uses the Python Node to call multiple Python functions. How do I ensure that my Python functions will execute in parallel?

Solution

To execute Python functions in parallel, each Python Node call must use its own unique Python session. If you make multiple parallel Python Node calls using the same Python session, the Python Nodes will still execute in sequence rather than in parallel.

The following is an example of calling two Python functions in parallel using two separate Python sessions. The single-iteration While Loops are required for the two Python processes to run in parallel in LabVIEW 2022 Q3 and previous versions, but they are not necessary in LabVIEW 2023 Q1 and later.