通過(guò)LabPython將Python引入到LabVIEW中_第1頁(yè)
通過(guò)LabPython將Python引入到LabVIEW中_第2頁(yè)
通過(guò)LabPython將Python引入到LabVIEW中_第3頁(yè)
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、通過(guò) LabPython 將 Python 引入到 LabVIEW 中本文介紹如何使用 OpenG 中的 LabPython 模塊來(lái)將 Python 引入到 LabVIEW 中,可以加快 LabVIEW 的編程。 一、安裝環(huán)境 通過(guò) VIPM 安裝 OpenG 后,即可使用 LabPython 模塊。本機(jī)運(yùn)行環(huán)境為 Win64 , Python 為 。安裝的 LabPython 模塊為 ,需要的支持環(huán)境為 【This package was tested with Python2.5 on both Windows 7 x86 and Windows XP x86】可以繼續(xù)使用,只是需要設(shè)置一

2、下。二、編寫(xiě)寫(xiě)程序,運(yùn)行報(bào)錯(cuò)程 序在 PYTHON New Session_ogtk.vi 時(shí)就報(bào)錯(cuò):error code is the 1046 LabVIEWcannot initialize the script server.Ensure the serversoftware is installed.表明未安裝 Python 服務(wù)。解決方法如下: 新建一個(gè) VI ,重新設(shè)置 Python 的服務(wù)路徑:注: 在 64 位 的 Windows 下, python 會(huì)將 32 位 python27.dll 放在C:WindowsSysWOW64 ,而不是 C:WindowsSystem32

3、設(shè)置完成后, 重新運(yùn)行上一段代碼: 以下是 LabPython 作者 關(guān)于 1046 錯(cuò)誤的解釋?zhuān)篢he error code is the 1046 LabVIEW cannot initialize the script server. Ensure the server software is installed.And a few comments on the vi PYTHON set Server Path_ogtk.vi: It has a string input which according to the front panel (its missing a help s

4、tring!) is possible values : PythonServerArrayModule?Why use a string to select between two possible values?A properly crafted enum would be much simpler and less error prone for the user.The quick help window labels the values for this input astoken(empty: PythonServer). This is non standard and co

5、nsequently - misleading syntax. The Empty keeword is implicty (default), so a standard syntax would betoken (PythonServer)By the way, the standard python27.dll location seems to be C:WindowsSysWOW64python27.dll只是使用 Python 自帶的函數(shù)和模塊,只需要打包: Pythonxx.dll 即可最好的辦法是在目標(biāo)機(jī)器上安裝 Python 和需要使用的工具 包,然后在 LabVIEW.ini 文件中設(shè)置;增加一行 PythonServer=C:WINDOWSsystem32python27.dll 到LabVIEW.ini 通過(guò)以上方法基本可以實(shí)現(xiàn)調(diào)用 Python 的功 能,實(shí)現(xiàn) Python 在 LabVIEW 中的內(nèi)嵌運(yùn)行。 四、使用 Python ScriptNode 在程序中直接編寫(xiě) Python 語(yǔ)句 借用官方的例程,運(yùn)行成功!五、其他工具包Python Integration Toolkit該工具包是收費(fèi)的,比較好用,兼容 Python2.x 和 3.x

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論