Howdy, Stranger!

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

Supported by

Problem with sending parallel-port-triggers (EEG)

Hi,

I need your help with sending parallel-port-triggers for my EEG-experiment.
I used the inline-script like here. I also installed the parallel port trigger as written here. The PC runs in test mode. My presentation runs without any error messages in the debug window. The port number is right. The trigger script is integrated after the presentation of my stimulus.

However, the triggers do not appear in the EEG-programm (BrainVision). Do you have any idea why?

At least I can say that this inline-script has already worked for my experiment previously sending the triggers to BrainVision. Recently we had to change our stimulation-PC and install everything from the start. Now we can´t get the trigger in BrainVision.

Thank you so much for your help.

Comments

  • Hey,
    do you mean I should try without using test mode by downloading the Binaries only?
    Regards,
    katya

  • Hi katya,

    Yes, this is an alternative method that does not require test mode. Please carefully follow the steps I describe and please let us know if it works.
    If enough people report this method to be successful maybe @sebastiaan can put it in the official documentation.

    Best,
    Jarik

  • Hello everyone,
    I know this is redudant with the start of this thread, but maybe I can receive some more beginner level help from you ;)

    we have an experimental setup in OpenSesame (2.9.7) and want to send different triggers to the EEG recording in BrainVision Recorder.
    BrainVision Recorder uses the parallel port (so I can´t use the serial port via some inline_script as I have done in other experiments with other recording devices before).

    I downloaded this (http://osdoc.cogsci.nl/3.1/manual/devices/parallel/) plugin for OpenSesame, namely the parallel_port_trigger (download actually from here: https://github.com/dev-jam/opensesame_plugin_-_parallel_port_trigger).
    Since the running system is Windows 7 (64 bit), I followed and now completed the nine steps, including the “Digital Signature Enforcement Overrider” (DSEO), as to get the required driver (http://real.kiev.ua/avreal/download/#DLPORTIO_TABLE) running.

    The problematic point is now, how do I actually GET THE PLUGIN STARTED, may it be via the GUI or some inline_script oder other scripts(?) ???

    Please give me advices if you have managed a solution working for you in some way, or report any mistakes you made at first (so that I can check if all my settings are as they´re supposed to be).
    I´m a user on beginners level, so please explain steps that may seem obviously to you ;)

    Kind regards and thanks a lot, Adrian

    PS. Maybe this issue helps. If it is necessary, please comment about it (https://groups.google.com/forum/#!msg/psychopy-users/hbIO2wHK1KU

  • Hi Adrian,

    Please post your question only ones!

    The problematic point is now, how do I actually GET THE PLUGIN STARTED, may it be via the GUI or some inline_script oder other scripts(?) ???

    Plugins should appear in the item toolbar:
    http://osdoc.cogsci.nl/manual/interface/#the-item-toolbar

    And can be dragged into the overview area:
    http://osdoc.cogsci.nl/manual/interface/#the-overview-area

    Best,
    Jarik

  • Hi @katya and @TheAdriWest,

    Did either the alternative method or the documented method work for you?

    Best,
    Jarik

  • Hi Jarik,

    thank you for your answer. Sorry, I will stick to this thread here from now on. I tried both the documented method and the alternativ method (th one without the testing mode procedure). But neither worked for me.

    I get both items (parallel_port_trigger and parallel_port_trigger_init) in the item toolbar, but when I drag them into the overview area, I get an error message. It says: "Failed to load plug-in parallel_port_trigger_init (see debug window for stack trace)"
    The debug window says:
    "Plug-in error

    line: 80
    exception message: Failed to load plugin 'parallel_port_trigger_init'
    exception type: osexception
    Traceback:
    File "dist\libqtopensesame\widgets\tree_overview.py", line 534, in drop_event_item_new
    File "dist\libqtopensesame\misc\qtitem_store.py", line 78, in new
    File "dist\libopensesame\item_store.py", line 80, in new
    osexception:
    Failed to load plugin 'parallel_port_trigger_init'

    line: 28
    exception message: No module named py3compat
    exception type: ImportError

    Traceback:
    File "dist\libopensesame\item_store.py", line 77, in new
    File "dist\libopensesame\plugins.py", line 331, in load_plugin
    File "dist\libopensesame\plugins.py", line 303, in import_plugin
    File "C:\Program Files (x86)\OpenSesame\plugins\parallel_port_trigger_init\parallel_port_trigger_init.py", line 28, in
    ImportError: No module named py3compat" (end debug window)

    This error shows up with either the documented and the alternative way?
    What is this psy3compat?

    Do you have any futher suggestions about what I can do?
    Kind regards, Adrian

  • Hi Adrian,

    Yes, I would first test if sending triggers to the parallel port works at all by using the example scripts here by pasting them in a new inline script in a new experiment. This way you kind of 'isolate' the problem by not using a plugin nor your experiment.

    The py3compat thing sounds like the parallel_port_trigger plugin you use isn't OpenSesame 3 compatible. Did you download the latest release from Github?

    Best,
    Jarik

  • Hello everyone,

    I had the same problem with sending triggers. The alternative method works in our lab but only in the Windows test mode. But it works.

    But we have the same problems with the Plugin. Right now, we are working with an Inline-script to send our triggers. When the triggers have to be on the onset of the auditive stimuli it is working fine.

    However, for my master's thesis (with OpenSesame 2.9.7) I need the triggers not on the onset of the stimuli but rather after the beginning/ in the middle of the word. The point of time for sending triggers is different for each stimulus (with a range between 13 and 30 ms after onset of the word). Also the time interval between stimulus presentation has to be different (with a range between 500 and 800 ms).

    Right now, my script looks like this:

    global io

    trigger = self.get("condition")
    port = 0x378

    try:
    io.DlPortWritePortUchar(port, trigger)

    except:
    print 'Failed to send trigger!'

    self.sleep (self.get("ISI"))
    io.DlPortWritePortUchar(port,0)
    self.sleep (2)

    The variable ISI is for the different Interstimulus Interval. Has anyone any ideas how to manage sending triggers in the middle of the word?

    Kind regards,
    Miriam

  • edited August 2016

    Hey Jarik,

    I used OpenSesame 2.9.7 since in the newer versions there is no plugin folder in the OpenSesame folder.
    Plus, in the .py file of the parallel_port_trigger_init plugin there are lines saying

    "#import warnings
    import os
    import imp

    from libopensesame.py3compat import *
    from libopensesame import debug
    from libopensesame.item import item
    from libqtopensesame.items.qtautoplugin import qtautoplugin
    from libopensesame.exceptions import osexception"

    So it looks like the plugin has got everything required in terms of py3compat according to this site (http://osdoc.cogsci.nl/3.1/dev/plugin/).

    Are there any other possibilites why it might not work?

    Neither with the little example scipt in a new experiment did it work, nor could I insert the plugin from the item toolbox to the experiment overview.

    Do you have any other explanation why neither way works for me?

    Best regards, Adrian

  • @TheAdriWest and @Miriam:
    You can download all versions (including 2.9.7) of OpenSesame here:

    If you use OpenSesame version 2.9.7 refer to the documentation here because that is written for version 2.9 (hence the 2.9 in the URL)

    @TheAdriWest:

    I used OpenSesame 2.9.7 since in the newer versions there is no plugin folder in the OpenSesame folder.

    If you use OpenSesame version 2.9.7 you might succeed by using an older version (possibly v2.0) from the parallel_port_trigger plugin

    Neither with the little example script in a new experiment did it work, nor could I insert the plugin from the item toolbox to the experiment overview.

    If you are using the example scripts (I modded a little) below what does the debug window say?

    try:
        from ctypes import windll
        global io
        io = windll.dlportio # requires dlportio.dll !!!
        print 'The parallel port is opened'
    except:
        print 'The parallel port couldn\'t be opened'
    
    global io
    trigger = 1
    port = 0x378
    try:
        io.DlPortWritePortUchar(port, trigger)
        print 'Send trigger!'
    except:
        print 'Failed to send trigger!'
    

    @Miriam:
    I'm afraid it doesn't make to much sense to vary the trigger between 13 and 30 ms because a sound card will generally have this as a variation (in addition to some fixed delay). Read post below for example

    Best,
    Jarik

  • edited September 2016

    Hi everyone,

    it was quite a long way but now we can successfully send triggers. Thanks for your advice!
    For anyone still struggling, here is our solution (there may be some shortcuts or more straightforward solutions, but it probably gives you some helpful input).

    At first, we tried the 'official' way (http://osdoc.cogsci.nl/3.1/manual/devices/parallel/) by implementig the parallel_port 4.0 plugin. However, the plugin needed a file named py3compat, which our version of Open Sesame could not provide. Therefore, we installed older versions of Open Sesame in the next step and ended up with version 3.0.7 (py2.7, Windows 32). Additional to the installation of the parallel_port driver DLPortIO (as described in the link), we had to copy the signed file DLPortIO.sys to C:/Windows/SysWOW64/drivers (for the why see http://www.highrez.co.uk/Downloads/InpOut32/default.htm). A further pitfall was the windows test mode, which must be enabled even when the experiment runs.
    Unfortunatly, we were still unable to send triggers. Therfore, we discarded the parallelport_trigger plugin and used an inlinescript.
    Finally, the first triggers appeared on the EEG, but they were wiggy scrambled. We detected two reasons: a) When the trigger was read from a loop item, the function self.get("variable") was the appropriate way (and not the intuitive '[variable]'-notation).
    b) After each sent trigger, an additional trigger with the value 0 was necessary untill the next one could be sent (we used the function self.sleep() between the first trigger and the 0 trigger). Otherwise, there was a type of crosstalk between two non-0 triggers.

    In conclusion, we ended with this setup:

    • Windows 7 64-bit computer
    • EEG: BrainVision Recorder
    • Open Sesame 3.0.7 (py2.7, Windows 32)
    • installed driver DLPortIO(http://osdoc.cogsci.nl/3.1/manual/devices/parallel/)
    • copy of the signed file DLPortIO.sys here: C:/Windows/SysWOW64/drivers
    • permanently enabled windows test mode
    • and the following inlinescripts
    #Inlinescript 1
    #Init Trigger at the beginning of the experiment
            try:
                from ctypes import windll
                global io
                io = windll.dlportio # requires dlportio.dll !!!
            except:
                print 'The parallel port couldn\'t be opened'
    
    #Inlinescript 2
    #send trigger 0 right after the init
            global io
            trigger = 0
            port = 0xC090
            try:
                io.DlPortWritePortUchar(port, trigger)
            except:
                print 'Failed to send trigger!'
    
    #Inlinescript 3
    #send trigger (value defined in loopitem)
            global io
            trigger = self.get("trigger_value")
            port = 0xC090
            try:
                io.DlPortWritePortUchar(port, trigger)
            except:
                print 'Failed to send trigger!'
            #sleep 2 ms 
            self.sleep(2)
            #set pin 0
            global io
            port = 0xC090
            try:
                io.DlPortWritePortUchar(port, 0)
            except:
                print 'Failed to send trigger!'
    

    We hope that this documentation will help some of you! In the end, it was really satisfactory to send all those triggers ;)

    Best
    Adrian & Alex

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games