Connecting a USB device to MATLAB to receive data
31 views (last 30 days)
Show older comments
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 Comment
chrisw23
on 20 Jul 2023
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
Answers (2)
Ralf Handrich
on 25 Jun 2024
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
0 Comments
See Also
Categories
Find more on Hardware Discovery and Setup 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!