I've written a script to present attentional tasks to participants however
I need to send a TTL pulse to an external device at random intervals.
I'm using eprime 2 and I have added the parallel port in the devices and
left the standard settings. I've then put in an inline with the command
WritePort &H378, 255 however I am not getting any pulse.
Can anyone help?
Dave
To send a pulse, you must both turn the pulse on and then turn it
off, with some duration in between. WritePort &H378, 255 will just
set all bits to 1, you still need to wait a moment and then send them
back to 0. Something like this:
WritePort &H378, 255 ' all bits to 1
Sleep 20 ' wait 20 ms
WritePort &H378, 0 ' all bits back to 0
Of course, you should first initialize all bits to 0 way at the start
of your program. And this assumes that &H378 is the correct port for
your case, you may need to contact your IT staff to verify
that. Finally, I think PST has a sample program at their website
that you can download to demonstrate some of this.
-- David McFarlane, Professional Faultfinder
At this stage you probably need to explore your specific hardware
setup in depth a little more, and that is not something that I can do
remotely, so you need to contact the IT staff at your company, and
they will need some in-depth knowledge about using a parallel
port. For one thing you need to make sure that &H378 is the correct
port number for your particular use, and that you have wired up to
the correct pins on the connector. If it were me I would try using
the old DOS debug command or something equally primitive so that I
could make sure that I fully understood the hardware at hand before I
tried throwing E-Prime at it.
PST has a Knowledge Base article about this at
http://www.pstnet.com/e-prime/support/kb.asp?TopicID=1320
(registration & login required), you might also look at another
article at http://www.pstnet.com/e-prime/support/kb.asp?TopicID=1318
. You might also try Google to find more technical articles on the
parallel port in general.
Oh, and as long as we're using hex notation, let's change
WritePort &H378, 255
to
WritePort &H378, &HFF
shall we?
Good luck,