Effacer les filtres
Effacer les filtres

Compiling a IVI Driver in R2013a

1 vue (au cours des 30 derniers jours)
Shawn Mason
Shawn Mason le 11 Juin 2013
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 commentaire
Shawn Mason
Shawn Mason le 11 Juin 2013
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.

Connectez-vous pour commenter.

Réponse acceptée

Shawn Mason
Shawn Mason le 11 Juin 2013
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

Plus de réponses (0)

Catégories

En savoir plus sur Application Deployment dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by