Matlab and USB communications

Hello all,
I've been trying to get a piece of kit plugged on a USB port to
communicate with a Matlab program. I have been far from being
successful. Does anyone know how to talk to a USB port using Matlab?
Thanks for your time, Matthieu Atkinson
Hi Matthieu,

How you talk to the USB depends on what the device connected to it is.
For keyboards and mice, everything works as regular ADB mice/keyboards.
This is also true of USB devices that emulate ADB devices (Griffin's
iMate). Other devices, such as the keyspan serial adapter, act as a
serial port and can be accessed via psychserial. Another device that is
used by people in the forum, the ActiveWire card, is accessed in Matlab
via a .mex file that hooks in to the driver. What type of device are
you trying to connect?

Hope this helps,

Chris


park wrote:

> Hello all,
> I've been trying to get a piece of kit plugged on a USB port to
> communicate with a Matlab program. I have been far from being
> successful. Does anyone know how to talk to a USB port using Matlab?
> Thanks for your time, Matthieu Atkinson
>
>
>
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
> <http://rd.yahoo.com/M=194081.3897168.5135684.1261774/D=egroupweb/S=1707208961:HM/A=1706996/R=0/SIG=11p5b9ris/*http://www.ediets.com/start.cfm?code=30509&media=atkins>
>
>
>
> http://psychtoolbox.org
> POST a message to: psychtoolbox@yahoogroups.com
> UNSUBSCRIBE by sending a blank message to:
> psychtoolbox-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/>.
Matthieu,

Chris Taylor's reply was exactly right, with USB you program to the
device and not to the port, and you will need a C mex file to do that
from MATLAB.

What is the USB device which you are trying to connect and on what OS ?

If it is a USB HID device and you are using OS X then we provide a mex
file in the OS X Psychtoolbox alpha 0.3 release which should to read
from any USB HID device. So far I have used it with with keyboards,
mice and gamepads.

Best,

Allen

PS

The latest Windows MATLAB release lets you call a dll directly from
MATLAB, so that might be something to try in place of writing a mex
file in case you are using Windows.



On Thursday, September 25, 2003, at 02:02 AM, Christopher Taylor wrote:

> Hi Matthieu,
>
> How you talk to the USB depends on what the device connected to it is.
> For keyboards and mice, everything works as regular ADB mice/keyboards.
> This is also true of USB devices that emulate ADB devices (Griffin's
> iMate). Other devices, such as the keyspan serial adapter, act as a
> serial port and can be accessed via psychserial. Another device that is
> used by people in the forum, the ActiveWire card, is accessed in Matlab
> via a .mex file that hooks in to the driver. What type of device are
> you trying to connect?
>
> Hope this helps,
>
> Chris
>
>
> park wrote:
>
>> Hello all,
>> I've been trying to get a piece of kit plugged on a USB port to
>> communicate with a Matlab program. I have been far from being
>> successful. Does anyone know how to talk to a USB port using Matlab?
>> Thanks for your time, Matthieu Atkinson
>>
>>
>>
>> *Yahoo! Groups Sponsor*
>> ADVERTISEMENT
>> <http://rd.yahoo.com/M=194081.3897168.5135684.1261774/D=egroupweb/
>> S=1707208961:HM/A=1706996/R=0/SIG=11p5b9ris/*http://www.ediets.com/
>> start.cfm?code=30509&media=atkins>
>>
>>
>>
>> http://psychtoolbox.org
>> POST a message to: psychtoolbox@yahoogroups.com
>> UNSUBSCRIBE by sending a blank message to:
>> psychtoolbox-unsubscribe@yahoogroups.com
>>
>> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
>> <http://docs.yahoo.com/info/terms/>.
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> KnowledgeStorm has over 22,000 B2B technology solutions. The most
> comprehensive IT buyers' information available. Research, compare,
> decide. E-Commerce | Application Dev | Accounting-Finance | Healthcare
> | Project Mgt | Sales-Marketing | More
> http://us.click.yahoo.com/IMai8D/UYQGAA/cIoLAA/BEfwlB/TM
> ---------------------------------------------------------------------
> ~->
>
> http://psychtoolbox.org
> POST a message to: psychtoolbox@yahoogroups.com
> UNSUBSCRIBE by sending a blank message to:
> psychtoolbox-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>