How do I deploy MATLAB code which makes use of Data Acquisition Toolbox with a third party vendor?

조회 수: 14 (최근 30일)
I have written MATLAB code which uses the Data Acquisition Toolbox in combination with Data Translation hardware. I have installed the Data Translation Data Acquisition Toolbox for this and everything works fine in MATLAB. I now want to use MATLAB Compiler to deploy my MATLAB code as a standalone application. When I try to run the standalone application I receive the following error though:
The vendor 'dt' is not known. Use 'daq.getVendors()' for a list of vendors.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2017년 5월 17일
When deploying MATLAB code which makes use of Data Acquisition Toolbox in combination with a third-party vendor adaptor, there are a number of directories that need to be manually included with the compilation.
Add the following directories to your application by adding them to the "Files required for your application to run" in the MATLAB Compiler App or using the -a flag when working with "mcc":
1. The third party toolbox directory. The third party toolbox will typically have been installed in your Add-Ons installation folder as configured under "Preferences" -> "MATLAB" -> "Add-Ons". Find the correct toolbox sub directory below this location, the exact name will depend on the third-party adaptor you are working with.
2. $MATLABROOT\toolbox\daq\daqsdk. Where $MATLABROOT stands for your MATLAB installation directory and which can be found using the "matlabroot" function.
So, for example for Data Translation hardware, a call to "mcc" may become:
mcc('-e',...
'myApp.m',...
'-a',fullfile(matlabroot,'toolbox','daq','daqsdk'),...
'-a','c:\Users\MyUser\Documents\MATLAB\Add-Ons\Toolboxes\Data Translation Data Acquisition Toolbox');

추가 답변 (1개)

Keqin Xu
Keqin Xu 2020년 4월 22일
The above "Accepted Answer" didn't work for me. I had to include more paths in the mcc command, maybe it's an overkill but it works for me:
mcc('-e','myprog.m','-a',fullfile(matlabroot,'toolbox','daq','daqsdk'),...
'-a','C:\ProgramData\MATLAB\SupportPackages\R2017b\toolbox\daq\supportpackages\mcc\',...
'-a','C:\ProgramData\MATLAB\SupportPackages\R2017b\toolbox\daq\supportpackages\mcc\bin\win64\',...
'-a','C:\Users\MyUser\Documents\MATLAB\Add-Ons\Toolboxes\Data Translation Data Acquisition Toolbox\',...
'-a','C:\Users\MyUser\Documents\MATLAB\Add-Ons\Toolboxes\Data Translation Data Acquisition Toolbox\code\',...
'-a','C:\Users\MyUser\Documents\MATLAB\Add-Ons\Toolboxes\Data Translation Data Acquisition Toolbox\code\adaptor\',...
'-a','C:\Users\MyUser\Documents\MATLAB\Add-Ons\Toolboxes\Data Translation Data Acquisition Toolbox\code\adaptor\win64\',...
);

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by