本文介绍如何使用OpenG中的LabPython模块来将Python引入到LabVIEW中,可以加快LabVIEW的编程。
一、安装环境
通过VIPM安装OpenG后,即可使用LabPython模块。
本机运行环境为Win64,Python为2.7.9。
安装的LabPython模块为4.0.0.4,需要的支持环境为【
This package was tested with
Python 2.5
on both Windows 7 x86 and Windows XP x86】
可以继续使用,只是需要设置一下。
二、编写写程序,运行报错
程序在PYTHON New Session_ogtk.vi时就报错:
error code is the 1046 "
LabVIEW cannot initialize the script server. Ensure the server software is installed.
"
表明未安装Python服务。
解决方法如下:
新建一个VI,重新设置Python的服务路径:
注: 在64位的Windows下,python会将32位python27.dll放在C:\Windows\SysWOW64