#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

#### Categories

Supported by

edited September 14

I'm trying to run an old experiment created by someone else. I installed the old OpenSesame version (3.0 Interactive Ising), but I get the following error message:

File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\inline_script.py", line 116, in run
self.workspace._exec(self.crun)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\base_python_workspace.py", line 124, in _exec
exec(bytecode, self._globals)
Inline script, line 9, in <module>
File "C:\Program Files (x86)\OpenSesame\lib\ctypes\__init__.py", line 432, in __getattr__
dll = self._dlltype(name)
File "C:\Program Files (x86)\OpenSesame\lib\ctypes\__init__.py", line 362, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126]


I'm not very familiar with OpenSesame so I'd be very grateful for help with this.

• Hi @bwg ,

This error comes from a Windows library (.dll ) that the experiment fails to load. Presumably, the creator of the experiment installed this library manually and wrote a piece of inline_script that uses it. Can you post the inline_script that triggers the error?

­— Sebastiaan

• edited September 14

I think this is the inline script:

from psychopy import core
from ctypes import windll
import time

a = time.time()
timeout = 0.8

port = 61433
io = windll.dlportio

val = 0

while time.time() < a + timeout:
if val== 200 or val==64:
break

exp.set('response', val)

#get response time
response_time = time.time()
resp = (response_time - a) * 1000

exp.set("response_time",resp)

if resp > 799:
exp.set("response_time",0)

print(val)


• Hi @bwg ,

This script assumes that you have a file called dlportio.dll , which can be used to communicate through the parallel port. You can download dlportio.dll from many places on the internet, including dll-files.com. However, it seems that only 32 bit versions exist of this driver, which means that it's not compatible with the current 64 bit OpenSesame packages. It may work with the (outdated) 3.0 packages though, so you can try that. To install the dll simply extract it to the OpenSesame program folder.

-- Sebastiaan

• Thank you! Unfortunately, I now get a new error message (DLPORTIO.SYS device driver not loaded). Maybe it's because I'm trying to run a script on my laptop that was designed to take external input from a button box.

I found a version that ran on a desktop PC with keyboard input, but that version also doesn't run. The error is:

exception message: _allowed_responses not found

exception type: AttributeError

The allowed responses in the experiment are set to v;b. I have no idea how to even start trying to fix this.

• Thank you! Unfortunately, I now get a new error message (DLPORTIO.SYS device driver not loaded). Maybe it's because I'm trying to run a script on my laptop that was designed to take external input from a button box.

That means that dlportio is not properly installed, presumably because there is an additional file dlportio.sys that is required in addition to the .dll and that is currently missing.

The allowed responses in the experiment are set to v;b. I have no idea how to even start trying to fix this.

This sounds like a version-incompatibility, but based on this abbreviated error message it's difficult to say. In the console you can see the full error message. Can you post that here?

• Sorry for posting too little information. Here's the full error message:

Stopped

The experiment did not finish normally for the following reason:

• Unexpected error

## Details

• item-stack:experiment[run].Block_Loop[run].BlockSeq[run].Sequence_Loop[run].GameSeq[run].selection_loop[run].selection_seq[prepare].new_keyboard_response[prepare]
• exception message: _allowed_responses not found
• time: Thu Sep 15 12:59:12 2022
• exception type: AttributeError

## Traceback (also in debug window)

  File "dist\libqtopensesame\misc\process.py", line 140, in run
File "dist\libopensesame\experiment.py", line 390, in run
File "dist\libopensesame\item_store.py", line 95, in execute
File "dist\libopensesame\item_store.py", line 110, in run
File "dist\libopensesame\sequence.py", line 49, in run
File "dist\libopensesame\item_store.py", line 110, in run
File "dist\libopensesame\loop.py", line 143, in run
File "dist\libopensesame\item_store.py", line 95, in execute
File "dist\libopensesame\item_store.py", line 110, in run
File "dist\libopensesame\sequence.py", line 49, in run
File "dist\libopensesame\item_store.py", line 110, in run
File "dist\libopensesame\loop.py", line 143, in run
File "dist\libopensesame\item_store.py", line 95, in execute
File "dist\libopensesame\item_store.py", line 110, in run
File "dist\libopensesame\sequence.py", line 49, in run
File "dist\libopensesame\item_store.py", line 110, in run
File "dist\libopensesame\loop.py", line 143, in run
File "dist\libopensesame\item_store.py", line 94, in execute
File "dist\libopensesame\item_store.py", line 126, in prepare
File "dist\libopensesame\sequence.py", line 106, in prepare
File "dist\libopensesame\item_store.py", line 126, in prepare
File "dist\libopensesame\keyboard_response.py", line 46, in prepare
File "dist\libopensesame\generic_response.py", line 312, in prepare
File "dist\libopensesame\generic_response.py", line 252, in prepare_allowed_responses
File "dist\libopensesame\item.py", line 280, in __getattr__


• Hi @bwg ,

You're using a very old version of OpenSesame, and I suspect that this is simply a bug that was present at that point (but has been fixed since). Unless there is a good reason to do otherwise, I would always use the latest version!

— Sebastiaan

• edited September 16

Thank you so much! People who use OpenSesame regularly told me that older experiments don't always work with the newer versions, so I first ran the experiment with the version with which it was created. Now I now better! It runs perfectly in the latest version. Thanks a lot!