Dear All, we are currently moving away from presentation towards opensesame for our EEG experiments. I am currently starting a new series of experiments and would rather not have to start with presentation and change over to opensesame during the experiment series. However, the only problem for me right now is that we don't have experience in programming python for the sending of the triggers. Therefore I was wondering if anybody has used it to send triggers during an EEG and if so, does it seem to be software dependent? Maybe somebody has a script already that I could try to integrate into my presentation. We are working with BrainAmp and BrainVision. I would be very grateful for any feedback! Christiane
Hi Christiane,
Thank you for your interest in OpenSesame!
Yes, that's certainly possible. On the documentation website you can find some example scripts that you can integrate into your experiment. Please note that this solution is Windows only. If you use a different platform, let us know.
Good luck and don't hesitate to post any further questions!
Cheers,
Lotje
Hi Lotje, thank you so much for getting back to me. I will have a look at it today. Right now I am working on a mac but in the lab we record our signals on a PC so that it is probably better to have the presentation protocol also on a PC. If there is a Mac version available or you have any suggestions regarding alternations in the script, I would be happy to learn. So again THANK YOU VERY MUCH!! Christiane
Hi Christiane,
You could use the script on your Mac as well: it will not crash but it won't do anything either. (You'll just see a warning message in your debug window.) So you can test your experiment with the trigger code on your Mac, but make sure to double-check it when you run it on the Windows PC that you use for the actual experiment.
I wouldn't recommend running the actual experiment on a Mac at the moment because the Mac packages are still a work-in-progress. But for building and testing the experiment it's fine, of course!
Cheers,
Lotje
Hi Lotje,
I'm a colleague of Christiane. We have some trouble getting this to work. We copied the dlportio.dll file to the OpenSesame folder (inside the Programs folder) as written on the linked page. But when we start our test experiment an error message appears saying that the dlportio.sys file was not found an the io-command therefore has no output. I tried to install the driver via the install.exe included in the zip archive but this didn't work at all on our Windows 7 PC. Is there any trick we're missing here? Or does it work only under XP?
Thanks a lot for your help,
Johannes
Hi Johannes and Christiane,
Yes, you're right! It appears to be Windows 7. We found a version of DLPortIO for 64-bit/ Windows 7:
And, what we forgot to mention in the documentation is that you need to run the installer as well. So thanks for pointing that out!
Could you please let us know whether this works for you so that we can include it in the documentation?
Best wishes,
Lotje
Hi Lotje,
Thanks for the link. I managed to install the driver. It was a little complicated (some passages of the readme file included with the driver are hard to understand), therefore I repeat the necessary steps here (maybe one could include this in the wiki):
1) Download the DLPortIO x64 driver from http://real.kiev.ua/avreal/download/#DLPORTIO_TABLE and uncompress the zip archive.
2) As Windows 7 has a strengthened security system (at least compared to XP) one cannot simply install the DLPortIO x64 driver. This won't work as Windows 7 will block all attempts of installing a not officially signed (by Microsoft) driver. Good for the security of an average user -- bad for us.
To bypass this restriction one has to use a little helper program called "Digital Signature Enforcement Overrider" (DSEO) which can be downloaded here: http://www.ngohq.com/home.php?page=dseo (of course there are other possible ways to do this but this program is mentioned in the DLPortIO-64-readme.txt and one does not have to dive deeper into MS Windows 7 architecture specialities).
3) Start DSEO with administrator privileges (right click on dseo13b.exe, select "run as administrator"). Now the DSEO window pops up. It just presents a list of options which operation to run next.
4) Choose the option "sign driver/sys-file" and press ok. Now another window appears where you have to type in the absolute path to the DLPortIO.sys file (only this one, not the dll!). Remember to escape spaces in the path if you have any (don't ask how long that took me) otherwise your files will not be found. Pressing ok will sign the sys-file.
5) Back in the DSEO list choose "enable test mode" and press ok. Then choose "exit" and restart your PC. (Windows 7 wrongly complains that DSEO might not be installed correctly -- just click on "yes, the software is installed correctly").
6) After boot up is completed you'll see that something like "Windows 7 test mode built #number#" is written on the desktop just above the clock in the starter-bar. That's necessary. You have to be in test mode to run this unofficially signed driver.
7) Now run DLPortIO_install.bat with administrator privileges (in Windows Explorer, right click the file, ...). Answer "yes" if Windows warns you about registry changes.
8) Reboot
9) Copy the DLPortIO.dll file to the folder containing opensesame.exe.
That's it. Of course, although this worked for me, I cannot guarantee that this will work or even will not harm your system in any way. It's your own risk.
Now I can execute my test experiment with the bits of python code from the documentation and no error or exception is raised in the debug window.
However, I tested this in our lab and no triggers appear in the BrainVision-Recorder Window. Obviously the triggers are a) not sent or b) don't get recognized by BrainVision-Recorder. At least I can say that everything is connected correctly because sending triggers with Presentation works.
Has somebody a hint how to proceed or even some experience with OpenSesame and BrainAmp/BrainVision?
Best wishes,
Johannes
Hi Johannes,
Thank you very much for your step-by-step explanation on how to install DLPortIo on Windows 7. That's really helpful! It sounds like you did everything correctly.
The most obvious thing that comes to mind is that you may not have specified the correct port. In the example it's set to 0x387 (=888) but you'll probably have to change it according to your set-up. If you specify the wrong port nothing will happen, but you won't get an error message either. You should be able to find the right port in Presentation.
Also, for testing it's best to send a series of two different triggers because the EEG apparatus will only notice a trigger change. The format of the trigger should not depend on the specific EEG apparatus you're using (as far as we know), so you don't have to worry about that.
Finally, if you tried all of the above and you still don't get it to work, you may want to have a look at the following post on the PsychoPy mailinglist, where someone reported success with the same issue:
PsychoPy uses Python just like OpenSesame, so this solution should work for OpenSesame as well.
Good luck and let us know how it goes.
Lotje
Hi Lotje,
Thank you! It works! Yes!! :)>-
I had already found out that the port number was 0x4cf8 for our PC (it's a Laptop with a parallel express card, that's why it has that non standard number), so that was correct.
Your hint with sending two triggers did the trick. When I do this, both triggers appear in the EEG recording window.
Wow, I'm really happy that I got this working. Thanks again for your help!
Best wishes,
Johannes
P.S.: Now some follow up question comes into my mind. But I will start a new thread for this as the basic trigger sending problem is solved.
Hi Johannes,
I'm very glad to hear that!
It's the change from one byte to another that is used as the trigger event by the EEG apparatus, not the byte itself. That's why the code should always be alternating between the to-be-time-stamped events.
I just wanted to give you two hints for the proceeding of your EEG experiment:
Cheers,
Lotje
Follow @cogscinl