필터 지우기
필터 지우기

Compiling a IVI Driver in R2013a

조회 수: 1 (최근 30일)
Shawn Mason
Shawn Mason 2013년 6월 11일
I'm having trouble compiling an IVI device driver. I've installed IVI shared components and the instrument driver. Everything works well in the MATLAB environment but I get the following error when running the compiled code:
"The VXIplug&play driver could not connect to the instrument using the specified resource. If this error is not an instrument error, use MIDEDIT to inspect the driver."
handles.rfswitch_tcp_config = icdevice('VTEXSwitch.mdd', ['TCPIP::' remote_ip '::INSTR']);
try
connect(handles.rfswitch_tcp_config);
catch ME1
disp(ME1.message)
end
Is there a dependency I need to include the MATLAB path when compiling? I see alot of file in C:\Program Files\IVI Foundation\IVI. I'm runing 32-bit R2013a in Windows XP.
Thanks
  댓글 수: 1
Shawn Mason
Shawn Mason 2013년 6월 11일
I modified the icdevice.m file to get more information. Error is being thrown in the following function call:
if (~libisloaded(driverName))
errflag = localLoadLib(driverName, binary, includeFile, includePath, visaIncludePath)
end
After attempts to call "loadlibrary" the following exception message is generated:
Deployed applications must use a prototype file instead of a header file. To create the prototype, use the loadlibrary mfilename option. Use the prototype file in compiled code. See http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/brb8oui.html for more information.

댓글을 달려면 로그인하십시오.

채택된 답변

Shawn Mason
Shawn Mason 2013년 6월 11일
Found workaround, but unfourtunately breaks base-MATLAB and is device specific. I asked Mathworks for help with a more elegant solution now that I have a better idea of what the problem is.
1) Created prototype file by modifying this line in icdevice.m.
[~, warninginfo]= loadlibrary(binary, includeFile, 'mfilename', 'VS', 'alias', driverName, ...
includepath', primaryPath,'includepath', char(secondaryPath(1)), 'includepath', char(secondaryPath(2)));
2) Modified icdevice.m to call prototype if deployed.
if isdeployed
[~, warninginfo]= loadlibrary(binary, @VS, 'alias', driverName, ...
'includepath', primaryPath,'includepath', char(secondaryPath(1)), 'includepath', char(secondaryPath(2)));
else
[~, warninginfo]= loadlibrary(binary, includeFile, 'alias', driverName, ...
'includepath', primaryPath,'includepath', char(secondaryPath(1)), 'includepath', char(secondaryPath(2)));
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Application Deployment에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by