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

5 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 17 Mag 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');

Più risposte (1)

Keqin Xu
Keqin Xu il 22 Apr 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\',...
);

Tag

Non è stata ancora inserito alcun tag.

Prodotti


Release

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by