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
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');
0 个评论
更多回答(1 个)
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\',...
);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface) 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!