Connecting a USB device to MATLAB to receive data

조회 수: 30 (최근 30일)
Kevin
Kevin 2023년 7월 13일
답변: Ralf Handrich 2024년 6월 25일
Hello.
I am trying to connect a device that collects data and outputs that information through a usb to a computer. A software exists to receive the information but the goal is to bypass that and send the information directly to matlab. The device streams 43 bytes every 53 usec, the packet structure starts with a 16 byte header that starts with ASCII spelling out yoho, bytes 17-19 contain status of the device and bytes 20-43 contain the information of the sensors, the information in bytes 20-43 are split into three byte chunks (ex. s1 20-22, s2 23-25, s3 26-28). The device is sampling at 19.23 kHz so if the data cant be received at that speed or faster the data is not viable.
Thank you for any assistance
-KT
  댓글 수: 1
chrisw23
chrisw23 2023년 7월 20일
Look for a .net compatible driver, load the assembly and instantiate the class to get a driver object.
asm = NET.addAssembly(<pathToYourUsbDriver.dll> ) % look for classes provided under asm.Classes
myDrvObj = <identifiedUsbDriverClass>
myDrvObj.<OpenCommunication> % i.e. to open device communication
use details(myDrvObj) / methodsview(myDrvObj) to get API informations or read the API description provided

댓글을 달려면 로그인하십시오.

답변 (2개)

Rishav
Rishav 2023년 9월 4일
편집: Rishav 2023년 9월 5일
Hi Kevin,
I understand that you are trying to receive information from USB directly to MATLAB.
Please refer to the below mentioned documentation for the same:
Also refer to this documentation for a brief idea on 'serial' function:

Ralf Handrich
Ralf Handrich 2024년 6월 25일
Hello Kevin,
you can try AHid.dll. It's a commercial product, but there is also a free version that you can try:
Best regards, Potter

카테고리

Help CenterFile Exchange에서 Hardware Discovery and Setup에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by