Testing the parallel port triggers with psychopy code

I am trying to send triggers via a parallel port using a new EEG system (BioSemi ActiveTwo). I have a Windows stimulus presentation machine that runs Psychopy. It has a parallel port that is connected to the EEG data collection computer via a parallel port cable. I have tried to send triggers using Psychopy code that has worked for me before on other systems, but it is not working now. I suspect the problem is not to do with Psychopy or Python, and may be something to do with device drivers. But I would like to ask for people’s opinion on the results of the following Psychopy code test that I did.

Using Standalone PsychoPy-2023.1.0 installed on Windows, in the Python console, I did the following:

from psychopy import parallel
parallel.setPortAddress(address=0x0378)

No error messages of any kind so far.
Then I did

parallel.setPin(3, 1)

which, I believe, sets pin 3 to a value of 1.
Then, I did

parallel.readPin(3)

and it returned 0.

I presume that indicates that everything is not working correctly and if it were, I would have obtained a value of 1 instead.

Trying something further, I did

parallel.setData(0)

which I believe sets all pins to 0.
Then I tried to read multiple pins as follows:

parallel.readPin(3) # returns 0
parallel.readPin(4) # returns 0
parallel.readPin(5) # returns 1
parallel.readPin(6) # returns 1
parallel.readPin(7) # returns 1
parallel.readPin(8) # returns 1
parallel.readPin(9) # returns 0

I presume that’s not what should have happened either if everything is working; I should have got 0 for all pins, I assume.

Then I did

parallel.setData(255)

which I believe sets all pins to 1. When I did the readPin tests as before, the same ones were 0 and 1, just like when I did parallel.setData(0), e.g. parallel.readPin(3) returns 0, parallel.readPin(5) returns 1, etc.

From all of this,I assume that this confirms that the parallel port, or the Python interface to it, is not working. Is that a correct assumption? In other words, if I were on a system that worked, i,e. where Psychopy could send triggers, and I did the above test, I assume that readPin would indicate the pins would values like all 0 or all 1. Unfortunately, I can’t do this test myself because I just have this one system to work with.

Is there any way you can check on the EEG-system-side whether it received the trigger? Like does the acquisition system have a live data viewer with the parallel port channel that can report what’s being transmitted? Two-way communication through a parallel port (i.e., sending and reading from pins) can be a nightmare. Sometimes, certain parallel ports only allow you to EITHER send (i.e., change pin from 0/1) OR read, so if that’s the case for you, your troubleshooting method wouldn’t work.

Have you verified the address of the parallel port (e.g., using Device Manager)? If the parallel port is on an add-in card (e.g., PCI bus) it is highly unlikely that Windows assigned it to the legacy 0x0378 address.