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

5 vues (au cours des 30 derniers jours)
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.

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 17 Mai 2017
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');

Plus de réponses (1)

Keqin Xu
Keqin Xu le 22 Avr 2020
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\',...
);

Tags

Aucun tag saisi pour le moment.

Produits


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by