# Sending a conditional parallel port trigger breaks experiment

**URL:** <https://discourse.psychopy.org/t/sending-a-conditional-parallel-port-trigger-breaks-experiment/29974>\
**Category:** Builder\
**Created:** [July 11, 2022, 9:57pm UTC](https://discourse.psychopy.org/t/sending-a-conditional-parallel-port-trigger-breaks-experiment/29974 "2022-07-11T21:57:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Honeybadger](https://avatars.discourse-cdn.com/v4/letter/h/da6949/32.png) [@Honeybadger](https://discourse.psychopy.org/u/Honeybadger)\
**Post date:** [July 11, 2022, 9:57pm UTC](https://discourse.psychopy.org/t/sending-a-conditional-parallel-port-trigger-breaks-experiment/29974/1 "2022-07-11T21:57:54Z")

</div>

**OS** (e.g. Win10): Win10

**PsychoPy version** (e.g. 1.84.x): 2022.1.3

**What are you trying to achieve?:**  
I am trying to send a trigger code to a parallel port when a word stimulus is displayed on screen, 20 if a word has been seen, 10 if it has not. The parallel port is attached to a BioNex box.

**What did you try to make it work?:**  
I am representing my stimuli set using two arrays, where index i corresponds to the word in one array and whether the word has been seen or not in the second array.

So my arrays would be like:  
words = [“word1”, “word2”]  
testOldNew = [“new”, “old”]

My parallel port component in builder view is this:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/b/d/bdd139b1915fcc1be28aab2124483b7c4ebc727d.png)

![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/e/a/eac766bf10e7d7dbb65caf67057fb056148be062.png)

**What specifically went wrong when you tried that?:**  
When I run this, I get the trigger code appearing in BioLab, then my experiment gets stuck on a grey screen forever. It does not send any error codes.

---

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [July 12, 2022, 9:48pm UTC](https://discourse.psychopy.org/t/sending-a-conditional-parallel-port-trigger-breaks-experiment/29974/2 "2022-07-12T21:48:29Z")

</div>

Hi There,

if you experiment is stuck on a gray screen I wonder if something else in the routine is also preventing the experiment from progressing - please may you share your psyexp file?

thanks,  
Becca

---

<div class="post-metadata">

**Author:** ![Honeybadger](https://avatars.discourse-cdn.com/v4/letter/h/da6949/32.png) [@Honeybadger](https://discourse.psychopy.org/u/Honeybadger)\
**Post date:** [July 12, 2022, 10:24pm UTC](https://discourse.psychopy.org/t/sending-a-conditional-parallel-port-trigger-breaks-experiment/29974/3 "2022-07-12T22:24:33Z")

</div>

Hi,

Sure thing, here it is.

[MemoryTask.psyexp](https://discourse.psychopy.org/uploads/short-url/iALZYUYIhBRyrcd6VxGx1v8G9FZ.psyexp) (121.2 KB)

In the testing trial component, if you disable the the p\_port components or start them with a duration instead of a condition, the experiment works as intended.

Thanks a ton!

---

<div class="post-metadata">

**Author:** ![Honeybadger](https://avatars.discourse-cdn.com/v4/letter/h/da6949/32.png) [@Honeybadger](https://discourse.psychopy.org/u/Honeybadger)\
**Post date:** [July 12, 2022, 10:40pm UTC](https://discourse.psychopy.org/t/sending-a-conditional-parallel-port-trigger-breaks-experiment/29974/4 "2022-07-12T22:40:51Z")

</div>

Here is the entire folder, which should be able to run as is

[MemoryExperiment.zip](https://discourse.psychopy.org/uploads/short-url/yswFYXVi092tlfpai84HWF1xmeS.zip) (6.7 MB)

---

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [July 14, 2022, 5:38pm UTC](https://discourse.psychopy.org/t/sending-a-conditional-parallel-port-trigger-breaks-experiment/29974/5 "2022-07-14T17:38:50Z")

</div>

ok yes that does run fine my end - which routine is it where the gray screen happens?

---

<div class="post-metadata">

**Author:** ![Honeybadger](https://avatars.discourse-cdn.com/v4/letter/h/da6949/32.png) [@Honeybadger](https://discourse.psychopy.org/u/Honeybadger)\
**Post date:** [July 15, 2022, 10:47pm UTC](https://discourse.psychopy.org/t/sending-a-conditional-parallel-port-trigger-breaks-experiment/29974/6 "2022-07-15T22:47:26Z")

</div>

Hi,

I think the zip file I sent had that code disabled, sorry!

So it happens in the second phase of the experiment, in the TestingTrial component.

If you run this  
[MemoryExperiment.zip](https://discourse.psychopy.org/uploads/short-url/7IWx2cuQF3szlGM5EQYlODm1Mja.zip) (7.6 MB)  
, press q to skip the first phase.  
After the “In this phase of the experiment…” screen, words will start appearing again. If I press ‘f’ or ‘j’, that is where the gray screen happens.

I’ve been trying to follow the code described in this post: [Send trigger (biosemi actiview) for every key press - Builder - PsychoPy](https://discourse.psychopy.org/t/send-trigger-biosemi-actiview-for-every-key-press/27435/3).

Thanks!
