Re: Mac-Windows communication

>Hello David,
>Thank you for the new version of ToolBox.
>Several weeks ago, I sent you an email asking
>about the MAC USB communication, as well as
>the communication between serial ports of a
>PC and a Mac.
>
>Now we tried it by ourselves. The communication
>between PC and Mac works fine! So we can use a
>Mac running Matlab to display visual stimulus
>and use a PC to acquire data.
>
>We connected a 9-PIN PC port connector to a 8-PIN
>Mac port connector using 5 cables:
> PC MAC
>CTS DTR
>DTR CTS
>RxD TxD-
>TxD RxD-
>GND GND
>
>and ground Mac RxD+.
>
>We are using an old Mac for visual stimulus. New Macs
>do not have serial ports. Do you have plan to implement
>a MEX file in your ToolBox to control USB ports?

I'm forwarding your response to the Psychtoolbox
Forum in case it is helpful to others. With regard
to a USB function, we don't have immediate plans
to implement one, but it certainly could be done.
We can add it to our longterm list but I wouldn't
say it is a priorty right now. You can purchase
cards with serial ports quite cheaply, which
is a way to do serial communciations on newer
Macs.

DB
>
> >We are using an old Mac for visual stimulus. New Macs
> >do not have serial ports. Do you have plan to implement
> >a MEX file in your ToolBox to control USB ports?

Applications do not directly control USB ports. Instead they call device
drivers which call the operating system's USB stack which sets registers in
the USB hardware, controlling the ports. Applications are usually blind to
the fact that the devices which they communicate with are on the USB bus,
because all the USB stuff is hidden to them, on the underside of the device
driver on down. This is unlike with RS-232, where applications often talk to
a port driver, not to a device driver for the hardware at the other end of
your serial cable. It can work that way with RS-232, but with USB that
arrangement is pretty much unavoidable.

Despite what David said, I think the answer is that we would not support
controlling USB ports in the Psychtoolbox. However, if you would like to
control from within Matlab a particular USB device or class of USB devices,
then it is possible that we would add support to the Psychtoolbox for
them. ( on that subject, Psychtoolbox universal USB joystick drivers for
Windows should be out within the week, and, separately, I have one of these
http://www.activewireinc.com/usb_info.htm in hand)

As for communicating between two machines: USB is a master/slave
arrangement, your computer, the master, directs communication over the bus
to downstream devices, the slaves. There can be only one master, but there
can be multiple slaves. It's not peer-to-peer like RS-232 where, except for
the mapping of signals to pins (DTE or DCE), both parties are equals. So
connecting two computers --USB master devices-- together isn't going to work,
unless you can find a USB gadget which sits between and mediates.


> You can purchase
> cards with serial ports quite cheaply, which
> is a way to do serial communciations on newer
> Macs.
>

Another option is the KeySpan USB to Serial adapter which does work with the
PsychToolbox SERIAL function on Mac.
http://www.keyspan.com/products/usb/usa28x/
http://www.us.buy.com/retail/product.asp?sku=10153361&loc=14577

There are other USB to Serial adapters for Mac available, and they would
probably work just as well with the Psychtoolbox as the Keyspan. I'm
mentioning the Keyspan specifically because I have one here, I've used it
with the Psychtoolbox, and it works.

Best,

Allen
there's a compnay called gee3 (www.gee3.com) that makes
serial ports for newer macintoshes, i've just installed it on one of
the newest g4s (dual 800mHz processors) and it seems to be
recognized by the serial('ports') command, although i haven't
tried anything else with it yet. it replaces the modem that comes
built in to most configurations, although it is optional. cheers,
-spor

--- In psychtoolbox@y..., David Brainard <brainard@p...> wrote:
> >Hello David,
> >Thank you for the new version of ToolBox.
> >Several weeks ago, I sent you an email asking
> >about the MAC USB communication, as well as
> >the communication between serial ports of a
> >PC and a Mac.
> >
> >Now we tried it by ourselves. The communication
> >between PC and Mac works fine! So we can use a
> >Mac running Matlab to display visual stimulus
> >and use a PC to acquire data.
> >
> >We connected a 9-PIN PC port connector to a 8-PIN
> >Mac port connector using 5 cables:
> > PC MAC
> >CTS DTR
> >DTR CTS
> >RxD TxD-
> >TxD RxD-
> >GND GND
> >
> >and ground Mac RxD+.
> >
> >We are using an old Mac for visual stimulus. New Macs
> >do not have serial ports. Do you have plan to implement
> >a MEX file in your ToolBox to control USB ports?
>
> I'm forwarding your response to the Psychtoolbox
> Forum in case it is helpful to others. With regard
> to a USB function, we don't have immediate plans
> to implement one, but it certainly could be done.
> We can add it to our longterm list but I wouldn't
> say it is a priorty right now. You can purchase
> cards with serial ports quite cheaply, which
> is a way to do serial communciations on newer
> Macs.
>
> DB