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