解決方案
可以的,Python節點可以呼叫使用NumPy以及許多其他package中的函式。以下範例為Python腳本和呼叫它的VI。
# First, import NumPy.
import numpy as np
def MaxMinMean(lvarray):
"""
This function returns the maximu, minimum and mean
values of the "lvarray" in a list.
"""
# Convert LabVIEW array into NumPy array.
nparray = np.array(lvarray)
# Calculate the max, min and mean values.
arrmax = np.max(nparray)
arrmin = np.min(nparray)
arrmean = np.mean(nparray)
return [arrmax, arrmin, arrmean]
- LabVIEW 2019 Block Diagram(程式區) 呼叫上述函式