parallel port?

I will need to send out a pulse to mark certain times to a device which collects physiological readings, to correlate what subjects are experiencing on-screen with physiological measurements at the exact same time. The device has a parallel port interface. No problem doing this from the PC, but where to even get started on the Mac? The Keyspan USB-to-parallel adapter only supports printers. At this point it looks like it will be a whole lot easier to re-write the rest of the task for Windows than to send out a little voltage blip from the Mac.

pulse output via serial handshake

If you only want to output a single pulse, consider using the handshake lines of the (Keyspan) USB-based serial output. That's what I am doing. It is rather simple to write the unix commands to set / reset the appropriate bit of the RTS and DTR lines. In fact, I have an Objective C class for this (which I'm ready to share), some interesting lines go like this:
_currentStateDTR = state;
if (state) _modemBits |= TIOCM_DTR; else _modemBits &= ~TIOCM_DTR;
OSStatus err = ioctl(_port4handshake, TIOCMSET, &_modemBits);
... etc.
One can also use the 2 input handshake lines.

Best, Michael.
--
Prof. Michael Bach PhD, Ophthalmology, University of Freiburg, Germany.
www.michaelbach.de

It should be easy

If you already have the Keyspan USB-to-parallel port then it should be simple to use it. Just find the device mounted in the "/dev" directory. It probably has "USB" in the name. Open it and stream in data. For a blip try sending it a "0x00, 0xff, 0x00" combination.

You should also be able to test it out on the terminal, just do the following:

echo -ne "\x00\xFF\x00" > /dev/myUsbDeviceName

This writes a blip to the parallel port. The "-n" suppresses the new line character while the "-e" allows echo to read the hex values.

I think it should work. But then I have not done this sort of thing in a while.

William

bash specific

It is worth noting that this is a bash specific use of echo. If you're a long time OS X user (since pre 10.2, I believe), and you've been carrying around your account, you might be using tcsh. Or, like me, you could be explicitly using tcsh.

Just wanted to mention this.