MATLAB Answers

0

Does MATLAB support USB communication?

I would like to communicate with USB devices via a USB port. I would like to know if this is possible from MATLAB.

1 Answer

Answer by MathWorks Support Team on 21 Aug 2019 at 4:00
Edited by MathWorks Support Team on 21 Aug 2019 at 19:32
 Accepted Answer

MATLAB does not provide a generic USB interface. Having an interface of this type would be in some ways like having a direct interface to either the PCI or ISA bus.
The Data Acquisition, Instrument Control, and Image Acquisition Toolboxes all support some USB devices. The list of supported hardware for each of these toolboxes is available respectively from:
For each of these USB devices, communication is handled by the driver of the device, and not by MATLAB. For example when using the National Instruments DAQPad-6024E, which is an external data acquisition device, the communications is handled entirely by the National Instruments NIDAQ driver.
One possible option is using virtual COM ports (over USB) with MATLAB serial. This can be possible only if there is a virtual COM port driver provided by the vendor.
Another option would be to create a MEX function that can communicate with a generic USB system driver. This function would serve as the glue between MATLAB and the device.
As of MATLAB 6.5 (R13) users have the ability to directly access any Dynamic Link Library (DLL) in Microsoft Windows. This functionality can be use to interface with a generic USB driver. For more information please consult the MATLAB Interface to Generic DLLs section of the documentation under the section titled "External Interfaces":

  0 Comments

Sign in to comment.