How to ensure that a MATLAB executable can communicate with NI Data Acquisition Cards
4 views (last 30 days)
Show older comments
Dear community,
I want to create a small Matlab GUI which can handle NI DAQ devices. Later, I want to compile my application to an executable (.exe), such that the non Matlab user can do some easy measurements on the fly.
I know that I need to install the NI DAQmx support package from the addon installer to make it possible to work with the DAQs in Matlab, but how can I provide that package in such a way that the user can use my executable (of course together with the respective Matlab Runtime). Is it possible, that the user installs the NI DAQmx driver externally, such that the executable can use it? Which NI DAQmx version does it have to be? Is the base variant already enough for that purpose?
best regards
Jonas
5 Comments
Mario Malic
on 21 Apr 2023
Hey Jonas, I posted my DAQ app, which you might be interested in https://uk.mathworks.com/matlabcentral/fileexchange/128118-daqx
Answers (1)
Shubham
on 7 Apr 2023
Hi Jonas,
To create a small Matlab GUI that can handle NI DAQ devices, you will need to use the Data Acquisition Toolbox and the NI-DAQmx support package. You can create a standalone executable of your Matlab application by using the MATLAB Compiler.
To deploy your application to a non-Matlab user, you will need to provide them with the compiled executable and the respective Matlab Runtime that your application was built on. You can package these files together into a single installer file using the MATLAB Compiler.
As for the NI-DAQmx driver, you have a few options. You can include the NI-DAQmx driver installer with your application installer and ask the user to install it before running your application. Alternatively, you can include the driver files directly in your application installer and install them automatically during the installation process.
The version of the NI-DAQmx driver you will need depends on the version of the NI-DAQmx support package you are using in Matlab. You can find this information in the release notes of the support package. The base version of the NI-DAQmx driver may be sufficient for your application, but it's best to check the compatibility requirements of your version of the support package to be sure.
1 Comment
Brian
on 12 Jul 2023
"Alternatively, you can include the driver files directly in your application installer and install them automatically during the installation process."
How do you enable this? I added ni-daqmx_21.3_online.exe in the "Files installed for your end user" section of the deploy tool, but all that does is add it to the install folder. I could detect that the driver isn't installed on the first run of the app and trigger the install from there, but I'd rather it happen on app install.
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!