# Input/output via parallel port in linux

**URL:** <https://psychtoolbox.discourse.group/t/input-output-via-parallel-port-in-linux/433>\
**Category:** Uncategorized\
**Created:** [May 21, 2012, 3:34am UTC](https://psychtoolbox.discourse.group/t/input-output-via-parallel-port-in-linux/433 "2012-05-21T03:34:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiisudankan](https://avatars.discourse-cdn.com/v4/letter/k/977dab/32.png) [@kiisudankan](https://psychtoolbox.discourse.group/u/kiisudankan)\
**Post date:** [May 21, 2012, 3:34am UTC](https://psychtoolbox.discourse.group/t/input-output-via-parallel-port-in-linux/433/1 "2012-05-21T03:34:56Z")

</div>

Hi Mario and Listers,  
  
I was wondering if there is any update on sending and receiving TTL triggers via the parallel port in Linux (using IOPort?)? I have tried ParportTTL to send triggers by following the instructions [here&nbsp;](http://tech.groups.yahoo.com/group/psychtoolbox/message/11961)but I get the following:  
  
WARNING: Empty receive from parallelPortServer - Timed out?!?  
WARNING: Unable to get acknowledge for command within timeout interval! (count = 0)  
WARNING: Roundtrip time 29.208899 msecs for TTL trigger exceeds 5 msecs  
  
I think that ParportTTL can't be used to receive triggers, right? But sending triggers is (for me at least) more important that receiving triggers so getting ParportTTL to work would be sufficient in the meantime.  
  
Thanks in advance,  
  
Keith

---

<div class="post-metadata">

**Author:** ![e\_flister](https://avatars.discourse-cdn.com/v4/letter/e/e36b37/32.png) [@e\_flister](https://psychtoolbox.discourse.group/u/e_flister)\
**Post date:** [May 21, 2012, 6:56am UTC](https://psychtoolbox.discourse.group/t/input-output-via-parallel-port-in-linux/433/2 "2012-05-21T06:56:11Z")

</div>

here's some alpha-quality code. sending and receiving should both work and be very fast (way under 1ms).  
  
[http://code.google.com/p/ratrix/source/browse/classes/util/parallelPort/pp.m](http://code.google.com/p/ratrix/source/browse/classes/util/parallelPort/pp.m)  
[http://code.google.com/p/ratrix/source/browse/classes/util/parallelPort/ppMex.c](http://code.google.com/p/ratrix/source/browse/classes/util/parallelPort/ppMex.c)  
  
feedback/testing desired! you need to compile the mex file, read the doc, run matlab as root, etc...  
-e  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "kiisudankan" \<keithjduncan@...\> wrote:  
> \>  
> \> Hi Mario and Listers,  
> \>   
> \> I was wondering if there is any update on sending and receiving TTL  
> \> triggers via the parallel port in Linux (using IOPort?)? I have tried  
> \> ParportTTL to send triggers by following the instructions here   
> \> \<[http://tech.groups.yahoo.com/group/psychtoolbox/message/11961](http://tech.groups.yahoo.com/group/psychtoolbox/message/11961)\> but I  
> \> get the following:  
> \>   
> \> WARNING: Empty receive from parallelPortServer - Timed out?!?  
> \> WARNING: Unable to get acknowledge for command within timeout interval!  
> \> (count = 0)  
> \> WARNING: Roundtrip time 29.208899 msecs for TTL trigger exceeds 5 msecs  
> \>   
> \> I think that ParportTTL can't be used to receive triggers, right? But  
> \> sending triggers is (for me at least) more important that receiving  
> \> triggers so getting ParportTTL to work would be sufficient in the  
> \> meantime.  
> \>   
> \> Thanks in advance,  
> \>   
> \> Keith  
> \>

---

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [May 22, 2012, 6:59am UTC](https://psychtoolbox.discourse.group/t/input-output-via-parallel-port-in-linux/433/3 "2012-05-22T06:59:02Z")

</div>

Am 21.05.2012 um 22:15 schrieb Erik:  
  

> \> i think octave understands mex files, right? then this should work for octave too... though it looks like some slight modifications to use oct would improve performance...  
> \> [http://www.gnu.org/software/octave/doc/interpreter/Mex\_002dFiles.html](http://www.gnu.org/software/octave/doc/interpreter/Mex_002dFiles.html)

I think mex-files work, but I've never tried it myself, since I see Octave primarily as Octave, and not Matlab without a price tag ...  
  
So if your code works on both platforms, then all the better!  
  
 Alex  
  
--   
Dr. Alexander Klein, Diplom-Mathematiker  
Physiologisches Institut der JLU-Gießen  
Aulweg 129  
35392 Gießen  
  
[http://www.med.uni-giessen.de/physio/](http://www.med.uni-giessen.de/physio/)
