# Sending Trigger via Parallel Port in Matlab

**URL:** <https://psychtoolbox.discourse.group/t/sending-trigger-via-parallel-port-in-matlab/79>\
**Category:** Uncategorized\
**Created:** [October 14, 2017, 9:55pm UTC](https://psychtoolbox.discourse.group/t/sending-trigger-via-parallel-port-in-matlab/79 "2017-10-14T21:55:06Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [October 14, 2017, 9:55pm UTC](https://psychtoolbox.discourse.group/t/sending-trigger-via-parallel-port-in-matlab/79/1 "2017-10-14T21:55:06Z")

</div>

Hi all,   
  
I have a similar problem as john.chen78 ([https://groups.yahoo.com/neo/groups/psychtoolbox/conversations/topics/21844](https://groups.yahoo.com/neo/groups/psychtoolbox/conversations/topics/21844)) but can’t reply to this chat for some reason.

I would like to send a trigger via parallel port in Matlab R2017b (but I also tried R2015b) on Windows 10. Therefore I used the following code. Looks like everything is running fine, but somehow the machine (Pathway from medoc) does not get a trigger.  
  
There are two different port addresses I/O Range DFF8-DFFF and DFF4-DFF7. I tried both.   
  
ioObj = io64;  
status = io64(ioObj);  
address = hex2dec('DFF8'); %DFF4   
data\_out=1;  
io64(ioObj, address, data\_out)  
  
I also tried parPulse (recommended on the Psychtoolbox website), but couldn't get that to work either.   
Did I miss anything?   
  
Thank you for any help,   
Erna

---

<div class="post-metadata">

**Author:** ![erna.weik](https://avatars.discourse-cdn.com/v4/letter/e/51bf81/32.png) [@erna.weik](https://psychtoolbox.discourse.group/u/erna.weik)\
**Post date:** [October 15, 2017, 11:00pm UTC](https://psychtoolbox.discourse.group/t/sending-trigger-via-parallel-port-in-matlab/79/2 "2017-10-15T23:00:03Z")

</div>

It works with parPulse..  
  
parPulse(hex2dec('DFF8'));   
parPulse(0,0,255,0);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
parPulse(9,0,15,1);

---

<div class="post-metadata">

**Author:** ![HuizhongWu](https://avatars.discourse-cdn.com/v4/letter/h/8edcca/32.png) [@HuizhongWu](https://psychtoolbox.discourse.group/u/HuizhongWu)\
**Post date:** [June 20, 2024, 10:17am UTC](https://psychtoolbox.discourse.group/t/sending-trigger-via-parallel-port-in-matlab/79/3 "2024-06-20T10:17:36Z")

</div>

> [@erna.weik](#):
>
> parPulse(hex2dec(‘DFF8’));  
> parPulse(0,0,255,0);  
> parPulse(9,0,15,1);

Hi,

Would you mind explain how to use parPulse send trigger to Neuroscan?

I used the trigger version of parPulse but cannot product a event file in Neuroscan, would you mind tell me is there something wrong in my code or is the parPulse function incompatible with Neuroscan?

```auto
parPulse(hex2dec('378'), 201, 1, 255, 2*10e-3,1)

```
