From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
為什麼LabVIEW在呼叫我的LabVIEW DLL的時候會出現當機?
主要軟體: LabVIEW Development Systems>>Full Development System
主要軟體版本: 8.2
主要軟體修正版本:
次要軟體: N/A
問題: 我將LabVIEW的一個VI轉換成了DLL,在我製作完這個DLL之後,我試著從一個新的LabVIEW VI中去呼叫它,但是當程式執行到Call Library Function Node的時候會導致LabVIEW當機。我該如何修復這個問題?
解答: 在從LabVIEW中呼叫LabVIEW製作的DLL的時候,有兩件事情您需要檢查一下:
1. 確保DLL函數呼叫方法和您在Call Library Function配置對話方塊中選的必須是一致。如果您不選擇的話,LabVIEW Default是使用C的呼叫方法給LabVIEW的DLL呼叫。在Windows中,您也可以選擇標準的呼叫方法(Stdcall)。在其他的作業系統裡,只有C的呼叫方法是允許的,所以不存在這個問題。呼叫方法不正確的現象是發生在函數運行的時候,在Block Diagram裡Call Function Library函數回傳時會引起LabVIEW當機。
2. 如果您正在顯示LabVIEW DLL的Front Panel,有兩個嚴格的要求去確保它能夠工作。
o Call Library Function呼叫的DLL必須設置成Reentrant。在執行分類(在 Browse button下)將Run in UI Thread 設置成 Reentrant。
在使用DLL的VI裏(LabVIEW開發環境裏呼叫LabVIEW製作的DLL的那個VI)在【
File » VI Properties » Execution】的型態不能為【user interface】。您可以在
File » VI Properties » Execution中檢查,並確保執行系統(Preferred Execution System )是【Standard】,【Instrument I/O】,【Data Acquisition】,【other1】,或者是【Other2】(如果在上層呼叫這個VI的VI是執行在【user interface】的話,對於呼叫此VI的VI也要這麼設置)。
相關連結:
附加檔案:
報告日期: 07/31/2006
最後更新: 08/06/2007
文件偏號: 228AA3IJ
Other Support Options
Ask the NI Community
Collaborate with other users in our discussion forums
Request Support from an Engineer
A valid service agreement may be required, and support options vary by country.