# Issue sending triggers using Neurospec USB-parallel port adapter

**URL:** <https://discourse.psychopy.org/t/issue-sending-triggers-using-neurospec-usb-parallel-port-adapter/2705>\
**Category:** Coding\
**Created:** [July 4, 2017, 6:38am UTC](https://discourse.psychopy.org/t/issue-sending-triggers-using-neurospec-usb-parallel-port-adapter/2705 "2017-07-04T06:38:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![srchekroud](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/srchekroud/32/40162_2.png) [@srchekroud](https://discourse.psychopy.org/u/srchekroud)\
**Post date:** [July 4, 2017, 1:57pm UTC](https://discourse.psychopy.org/t/issue-sending-triggers-using-neurospec-usb-parallel-port-adapter/2705/2 "2017-07-04T13:57:15Z")

</div>

Hey Brendan,

If it’s the case that you need to interact with the serial port rather than the parallel port, then I’m afraid i’m unable to help. If it’s an issue with the parallel port, then here’s some code that I’ve used successfully, although it’s with a 64 bit windows (but i think it’s comparable in principle…)

this snippet I had at the start of my experiment to initialise the parallel port

```auto
sendtriggers = False
#set parallel port params
if sendtriggers == True:
    IOport = parallel.setPortAddress(address = '0xD010') #change the address to whatever it is for the port on the comp in use
    holdvalue = 0 #reset the port to this after every trigger to avoid repeats, and reset all pins
    #IOport.setData(triggercode) # this is the code to send a trigger to the parallel port (i.e. to amplifier)
    #IOport.setData(holdvalue) # always send a zero value to reset all pins after a trigger to prevent repeated sending

```

whenever I’ve then needed to send a trigger, i simply do this:

```auto
IOport.setData(trigger_value) #whatever trigger value I have
IOport.setData(holdvalue) #this is zero

```

Your problem could be arising because you aren’t setting a handler for your parallel port:  
if the address of the port is right, maybe consider changing

`parallel.setPortAddress(0x00000008)`  
to  
`your_port_name = parallel.setPortAddress(0x00000008)`

then where you have `parallel.setPin(2,1)` change it to `your_port_name.setPin(2,1)`

Hopefully that may help - if not, then hopefully somebody else can step in with some 32bit specific advice!

---

_[View the full topic](https://discourse.psychopy.org/t/issue-sending-triggers-using-neurospec-usb-parallel-port-adapter/2705)._
