Hello, I need to solve an easy problem... apparently. Briefly, I want to do something like an oscilloscope with Matlab, receiving a signal via USB. I have done all the previous steps: I have my USB working, I have check that the computer receives the right data, etc.
Now, the problem is how to get data with Matlab. It's a simple communication, with one direction (USB to PC, with bulk transfers - but I could change this type), and I just need to read that data, just 2 bytes of data received continuously (because it's a digital signal with 16 bits resolution).
Thanks for your help.

6 件のコメント

Star Strider
Star Strider 2012 年 9 月 29 日
Since you probably do not have the Instrument Control Toolbox, I suggest you see the documentation for the core MATLAB serial objects. In my limited experience, you may need the documentation for the USB hardware in your data acquisition unit, since you have to tell MATLAB how to communicate with it. After that, you experiment.
Image Analyst
Image Analyst 2012 年 9 月 29 日
Please reconcile this: "I have check that the computer receives the right data" with this: " the problem is how to get data with Matlab". Exactly how is your computer receiving the data now, if it's not through MATLAB? Did you check it with some other program? Do you have the Data Acquisition Toolbox? You may not need that. I'm communicating with an MCC device just using base MATLAB and the Measurement Computing DLLs.
Star Strider
Star Strider 2012 年 9 月 29 日
His device probably came with its own software. I had a similar experience with a pulse-oximeter a few years ago. It took a bit of programming, but I finally got it to communicate with MATLAB in almost real time. (The device had its own high-resolution color LCD, very small but readable. When I plugged it in to the USB port for the first time, Windows found and installed the driver, so the interface itself wasn't a problem. The software the device came with only displayed its data on the monitor and wouldn't export anything at all, so I couldn't use it to generate files for offline analysis.)
What are the ‘Measurement Computing DLLs’? I never heard of them before. They seem worth knowing about.
Image Analyst
Image Analyst 2012 年 9 月 30 日
It's s company that makes all kinds of compact devices that connect to the computer via USB (or other methods) and do things like digital I/O, analog I/O, temperature measurement, ADC, DAC, etc. They're one of the supported vendors. See Vendors. I use their PMD-1024 USB device to detect switch closures on our light booths. So the user can just push a button on the light booth to snap a picture instead of having to interact with the computer. That way they can just put dozens of samples into the light booth and snap pictures without having to fiddle with the mouse and navigate the cursor over a "Take picture" button on some GUI. It really speeds things along. We have a pull up resistor on a pin on the device. When the user pushes the button, the pin shorts to ground. I poll the switch 20 times per second, and can check whether the pin is high or low (+5 volts or ground). See their web site for info: http://www.mccdaq.com/. It's pretty cool because it's easy and convenient. Like I said, I don't even need the Data Acquisition Toolbox to talk to the device.
Star Strider
Star Strider 2012 年 9 月 30 日
Thank you! I'll bookmark the Vendors links for it and their website.
It'd be nice if there was a way to generate a relatively low-priority interrupt rather than having to poll it. Maybe some day...
Walter Roberson
Walter Roberson 2012 年 9 月 30 日
Image Analyst -- you mean you develop those "4 pictures for $1" booths that are found in malls? ;-)

サインインしてコメントする。

 採用された回答

Palito
Palito 2012 年 10 月 21 日

0 投票

Thanks everyone for the info. I am using a PSoC device, and I found an easy way to communicate with PC: making USB work as a COM port, so I can easyly process data with Matlab :)

1 件のコメント

azadeh motamedi
azadeh motamedi 2017 年 11 月 23 日
how did you do this?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Acquisition Toolbox Supported Hardware についてさらに検索

質問済み:

2012 年 9 月 29 日

コメント済み:

2017 年 11 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by