Howdy, Stranger!

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

Supported by

Trigger EEG OpenBCI OpenSesame

edited July 2020 in OpenSesame

Dear All,

I am clinical and like most clinicians, I do not code, and I have difficulty putting triggers. I'm going to use OpenBCI as an eeg headset in a fairly simple experiment (see doc). 

I want to put a trigger at the start and end of the experiment and one for each appearance of stimuli. 

I'm following the procedure in tutorial but here is the error message: 

Traceback: 
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 4, in <module> 
NameError: name 'io' is not defined 

Can you help me? Thank you very much in advance. 


Arno

Comments

  • Hi @Arno ,

    The script in your experiment assumes that there is a variable called io that corresponds to the dlportio library. However, this variable needs to be created first, in a simple script. The procedure is explained on this page:

    It's also important to note that this code is for sending triggers across the parallel port (which is a common way to send triggers, but not the only way.). Are you sure that's how your OpenBCI EEG recording equipment works? (I don't know, and it's not obvious to me from the OpenBCI docs!)

    Cheers,

    Sebastiaan

  • Thanks Sebastiaan!!

    But I can't do it, I'm really bad ... I tried all the possibilities with window, but nothing always the same error message ... There is not a small video for the bad like me.

    Thank you and good coffee !!!

  • edited July 2020

    Hi Arno,

    Have you tried using this code:

    try:
        from ctypes import windll
        global io
        io = windll.dlportio # requires dlportio.dll !!!
    except:
        print 'The parallel port couldn\'t be opened'
    

    in the beginning of your experiment (before you do global io?)

    But as Sebastiaan has already said, I'm not sure whether you send triggers with Openbci with the parallel port. Maybe that is something you can ask at their user support?


    Eduard

    Buy Me A Coffee

  • Hello!

    So I found out where my problem was. The EEG (OpenBCI) goes through the USB port and not a parallel port. How can I send triggers from OpenSesame to OpenBCI via the USB port? Thank you very much the community.


    Arno

  • @Arno It seems that OpenBCI works through a Python library called brainflow . So the first step would be to install this. Next, you need to read the documentation for that library to see how you can connect to the device, and how you can send information to the BrainFlow logger (which would be similar to what you call a 'trigger'). I think you can do this with the log_message() function, but this is just based on a quick scan of their documentation. So first things first! I would start by carefully reading their documentation to get an idea of the OpenBCI workflow.

Sign In or Register to comment.