Communication between Matlab and National Instrument card
3 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying make a communication between Matlab and my NI-USB6221 card.
Here is my Matlab code :
loadlibrary('nicaiu.dll','nidaqmx.h','alias','myni')
taskh1=uint32(1);
[a,b,taskh1] = calllib('myni','DAQmxCreateTask','master',taskh1)
I precise that the files 'nicaiu.dll' and 'nidaqmx.h' are in the Matlab workspace (so I don't have to use addpath). And I don't have Data Acquisition Toolbox.
And this is what I get :
Warning: Warnings messages were produced while parsing. Check the
functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 381
??? Error using ==> loadlibrary at 461
There was an error loading the library "C:\Documents and
Settings\uidt1982\Desktop\CARTE_NI\nicaiu.dll"
*La procédure spécifiée est introuvable.*
Caused by: Error using ==> loaddefinedlibrary La procédure spécifiée est introuvable.
For the ones who doesn't speak french at all, the sentence in bold means : "the specified procedure cannot be found"
I don't understand this error and I am really stuck...
Some help would be welcome.
0 个评论
采纳的回答
Kaustubha Govind
2012-4-19
Looks like your header (nidaqmx.h) may be declaring methods that LOADLIBRARY cannot find in the DLL? What do you get in 'warnings' if you try:
>> [notfound,warnings]=loadlibrary('nicaiu.dll','nidaqmx.h','alias','myni')
0 个评论
更多回答(2 个)
Clownfish
2012-7-27
编辑:Walter Roberson
2012-7-27
Hi,
I have Matlab R2012a 32bit and a NI PCI-6229 card.
When I enter the command loadlibrary('nicaiu.dll','nidaqmx.h','alias','myni') I get a hell of Warnings. Seems that Matlab cant load the library.
Any Hints?
Here are the Warnings:
> In loadlibrary at 344
Warning: The data type 'error' used by function DAQmxGetTaskAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'FcnPtr' used by function DAQmxRegisterEveryNSamplesEvent does not exist.
> In loadlibrary at 403
Warning: The data type 'FcnPtr' used by function DAQmxRegisterDoneEvent does not exist.
> In loadlibrary at 403
Warning: The data type 'FcnPtr' used by function DAQmxRegisterSignalEvent does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetChanAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetChanAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetTimingAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetTimingAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetTimingAttributeEx does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetTimingAttributeEx does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetTrigAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetTrigAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetReadAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetReadAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetWriteAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetWriteAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetExportedSignalAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetExportedSignalAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetScaleAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetScaleAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetBufferAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetSwitchChanAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetSwitchDeviceAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetSwitchDeviceAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetSwitchScanAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetDeviceAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxCreateWatchdogTimerTask does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetWatchdogAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetWatchdogAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetCalInfoAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetCalInfoAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetPhysicalChanAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetRealTimeAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetRealTimeAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetPersistedTaskAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetPersistedChanAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetPersistedScaleAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetSystemInfoAttribute does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetDigitalPowerUpStates does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetDigitalPowerUpStates does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetDigitalPullUpPullDownStates does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetDigitalPullUpPullDownStates does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxSetAnalogPowerUpStates does not exist.
> In loadlibrary at 403
Warning: The data type 'error' used by function DAQmxGetAnalogPowerUpStates does not exist.
> In loadlibrary at 403
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 LabVIEW 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!