loadlibrary works on 32 bit but not 64 bit MATLAB

5 ビュー (過去 30 日間)
Emma
Emma 2017 年 4 月 3 日
コメント済み: Walter Roberson 2017 年 4 月 6 日
I am trying to load a set of dlls from National Instruments in MATLAB so that I can interface with the National Instruments DAQ card through MATLAB. This has worked in the past using 32 bit MATLAB (on a 64 bit machine) however it is not working on 64 bit MATLAB. How can I fix this?
I am running the following command: funclist = loadlibrary('nicaiu.dll','nidaqmx.h','alias','myni');
and get the following error:
"Error using loadlibrary There was an error loading the library "C:\Users\ecating\Documents\MATLAB\Version_1\V1_scripts_DoNotDelete\NI_DAQ_scriptsAndInfo\nicaiu.dll" C:\Users\ecating\Documents\MATLAB\Version_1\V1_scripts_DoNotDelete\NI_DAQ_scriptsAndInfo\nicaiu.dll is not a valid Win32 application.
Error in c_PCIE6321 (line 55) funclist = loadlibrary('nicaiu.dll','nidaqmx.h','alias','myni');
Caused by: Error using loaddefinedlibrary C:\Users\ecating\Documents\MATLAB\Version_1\V1_scripts_DoNotDelete\NI_DAQ_scriptsAndInfo\nicaiu.dll is not a valid Win32 application."
I am running MATLAB 2016b (version 9.1) on Windows 10.

回答 (1 件)

Varun Gunda
Varun Gunda 2017 年 4 月 6 日
The "is not a valid Win32 application" error usually means that you are attempting to load a 32-bit DLL using 64-bit MATLAB. Check if there are 64-bit versions of the NI DLLs available and download them. Or You can try installing 32-bit MATLAB on your 64-bit machine and use them as you were doing previously.
  1 件のコメント
Walter Roberson
Walter Roberson 2017 年 4 月 6 日
Note that R2015b was the last 32 bit version

サインインしてコメントする。

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by