執行NI-DAQ Visual C++ 範例程式(nidaqex.h)時出現錯誤



主要軟體:
主要軟體版本: 7.0
主要軟體修正版本: N/A
次要軟體: Measurement Studio>>Measurement Studio for Visual C++

問題:

當我在Visual C++底下嘗試編譯並執行資料擷取範例時會出現錯誤訊息:
Fatal error C1083: Cannot open include file: 'nidaqex.h': No such file or directory.



解答:

會出現此錯誤訊息的原因,是由於系統(utility)檔案與函式(function)是不可用的,有兩個可能的原因:

  1. NI-DAQ並未安裝到此電腦上。
  2. 安裝NI-DAQ時並未勾選外部編譯器支援的選項,外部編譯器包含Visual C++和Borland C++。


NI-DAQ提供所有National Instruments資料擷取卡產品的驅動程式。檔案nidaqex.h, nidaqex.lib 和 nidex32.dll 是運行任何NI-DAQ範例程式時所必須預先安裝的系統函式(utility functions)。這些檔案只有在安裝時勾選外部編譯器支援的情形下才會安裝,如果你沒有nidex32.dll 時你必須在安裝NI-DAQ時勾選此元件。在大多數的作業系統中,您可以修改您的安裝元件而不需要重新安裝。以下是系統函式(utility functions)的介紹和定義這些函式的原始檔案(source files):

以下的函式被提供以做為範例工具函式(Example Utility Functions),且在NI-DAQ的範例程式被使用:


對於 LabWindows/CVI, 這些函式被放置在一個名為NIDAQEX.C的source code裡。

對於其他Windows 32-bit 程式語言,這些函式被放置在NIDEX32.DLL。為方便您使用,一個靜態匯入函式庫 (static import library) 會包含在Windows NI-DAQ的LIB目錄底下.

要在何程式語言中使用這些函數 您必須include
LabWindows/CVI the NIDAQEX.H header file and the NIDAQEX.C file in your project
32-bit Visual C++ the NIDAQEX.H header file and link in the NIDEX32.LIB import libraryTo link a library in VC++, go to Project >> Settings , and select the Link tab. Add the library name to Object/library modules.
32-bit Borland C++ the NIDAQEX.H header file and link in the NIDEX32B.LIB import library
32-bit Visual Basic the NIDEX32.BAS file in your project



相關連結: KnowledgeBase 1CPG1HX4: NI-DAQ Visual C++ Example "DOsingbuffhandshake.c" Hangs My Computer when Used with PCI-DIO-32HS

附加檔案:





報告日期: 03/10/2003
最後更新: 03/03/2013
文件偏號: 2V9F4Q6I