from
Counter Example
by Scott Hirsch
An example using generic dll calling to use the counter on an NI daq card.
|
| loadNI; |
function param = loadNI;
%LOADNI calls loadlibrary with the appropriate input arguments.
%
% This function will call loadlibrary if needed with the predefined protocal file.
% This file is automatically generated by the loadlibrarygui.
%
% See also
% LOADLIBRARY, UNLOADLIBRARY, UNLOADNI
% Copyright 2002-2004 The MathWorks, Inc
%
%
% $Author: $
% $Revision: $
% $Date: 12-Feb-2004 10:05:04 $
%
% Local Functions Defined:
%
%
% $Notes:
%
%
%
%
% $EndNotes
%
% $Description:
%
%
%
%
% $EndDescription
% If Library is loaded already unload it.
if libisloaded('NI')
unloadNI;
end;
warningSetting1 = warning('off','MATLAB:loadlibrary:functionnotfound');
warningSetting2 = warning('off','MATLAB:loadlibrary:typenotfound');
warningSetting3 = warning('off','MATLAB:loadlibrary:enumexists');
% Load the library.
loadlibrary('C:\WINNT\system32\nidaq32.dll',@NI,'alias','NI');
if nargout
param = loadNIcns('D:\Applications\National Instruments\NI-DAQ\Include\nidaqcns.h');
end
warning(warningSetting1);
warning(warningSetting2);
|
|
Contact us at files@mathworks.com