NI LabVIEW,CVI,数据采集等产品讨论区

cancel
Showing results for 
Search instead for 
Did you mean: 

调用python节点1667错误

Highlighted

在labview中调用python节点,报错代码1667,Python returned the following error: <class 'SystemError'>..\Objects\listobject.c:189: bad argument to internal f误,当没unction。经查证,主要问题在于加载了python的numpy和scipy工具包出现错有使用工具包时,能正确返回结果。

python代码:import scipy.io as scio
import numpy as np
from scipy import optimize
def function(x,p,u,w):
return (18-p)*np.exp(u*w*x)*np.cos(w*x)+p
def residuals(sigma,y_hat,x):
p,u,w = sigma
return y_hat - function(p,u,w,x)
def jisuan(x,y_hat):
sigma0 = [0,0.01,0.5] # 参数的初始化值
plesq,pov = optimize.curve_fit(function,x,y_hat,bounds=([-20,-1,0.3],[20,0,1]))
return plesq
def ss():
return(jisuan([1,2,3,8,4,7],[3,5,8,7,8,9]))
print(ss())

 

labview代码:

1574134210(1).png

 

 

0 Kudos
Message 1 of 2
(650 Views)
Highlighted

请问,你这个问题解决了吗?如果解决了,是怎么解决的,方便告知吗?

0 Kudos
Message 2 of 2
(252 Views)