Howdy, Stranger!

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

Supported by

[open] Send triggers to parallel port with OpenSesame

PiaPia
edited March 2016 in OpenSesame

Hi,

I want to send trigger pulses to a parallel port with OpenSesame.
I downloaded the pulgin for parallel port triggers and saved it in the plugin folder.
Then I added my trigger pulse. I know the address from presentation (0x378).
The field for putting in these information looks different than in the documentation, though.
(I don't have a field to put in the time, only value and adress.)
So I put in the value (1 or 255) and the adress (0x378) and run the experiment.
But it gives the following error:

  File "dist\libqtopensesame\misc\process.py", line 140, in run
  File "dist\libopensesame\experiment.py", line 397, 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 50, in run
  File "dist\libopensesame\item_store.py", line 110, in run
  File "dist\libopensesame\loop.py", line 144, 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 121, in prepare
  File "dist\libopensesame\item_store.py", line 126, in prepare
  File "C:\Program Files\OpenSesame\plugins\parallel_port_trigger\parallel_port_trigger.py", line 99, in prepare
NameError: global name 'osexception' is not defined

What can I do about that?
I tried to download the dlportio.dll as descripted here: http://forum.cogsci.nl/index.php?p=/discussion/177/solved-sending-trigger/p1 and it worked until near the end but despite a lot of trials I could not execute the DLPortIO_install.bat . The error-message said the file is broken (in the terminal itself it said it could not find the file.)

I have Windows 7, 64 bit and downloaded the newest version of OpenSesame. In presentation the sending of triggers works.

Thank you very much for your help!

Comments

  • PiaPia
    edited March 2016

    This is what my experiment and the parallel port plugin looks like:

    image

    Does anyone have any idea?
    Thank you!

  • PiaPia
    edited 7:01AM

    I'm sorry to ask again, but I have no idea what to do... so do any of you have any? Also if it may not work I can try if I know what to try...
    Thank you!

  • edited 7:01AM

    Hi Pia,

    This is definitely a bug in the plug-in, so I forwarded this problem to @Bob, the developer.

    Cheers,
    Sebastiaan

  • edited March 2016

    Hi Pia,

    In the meantime, you might wanna try sending the triggers from within an inline_script. I ran an EEG experiment in this way and it worked quite nicely.
    So, here you go:

    In a first inline_script in the beginning of your script, you have to initialize the port connection.

    """
    establish connection to EEG port and set some general eeg related variables
    """
    try:
        from ctypes import windll
        global io
        io = windll.dlportio # requires dlportio.dll !!!
    except:
        print 'The parallel port couldn\'t be opened'
    
    # portAdress
    port=0x378
    

    Once set up, you can send triggers with io.DlPortWritePortUchar(port,trigger). However, I prefer doing it from within a little function.

    def sendTrigger(trigger,port=0x378):
        global io
        try:
            io.DlPortWritePortUchar(port,trigger)
        except:
            print 'Failed to send trigger %s!'% trigger 
    

    So, every time you want to send a trigger, you have to call sendTrigger(trigger) from within an inline_script. And also, don't forget to send the zero triggers in the same way.

    I don't know the exact structure of your experiment. Maybe it is necessary to change it to make the triggers being sent at the exact right time. But if you keep the prepare-run-phase in mind (send triggers during run, I suppose), you should be fine if you replace the parallel port plugin with an inline_script.

    I hope this helped.

    Good luck,

    Eduard

    Buy Me A Coffee

  • edited March 2016

    Hi all,

    I am back and actively working on this plugin again.

    Sorry for the unreported changes. I removed the time dimension: duration because it occurred to me it has no real use and forces a wait. Duration could become handy when it can run in parallel within the experiment. Also did not have the time for updating documentation. Done now! If there is a need to get the duration variable back, please let me know and I will put it back in.

    Did some bug fixes (untested) so it should work now. Gonna try to the test the changes tomorrow.

    In the future I will be more involved in the forum. The fastest way to get the bug reports is through github.

    Cheers, Bob

  • edited 7:01AM

    Seems additionally, dummy mode was always enabled and did not work when there was no pport and/or driver. All fixed in v3.1.

  • hi! I tried to use parallel port plugin and also check the serial plugin, but both of them did not give any response to my trigger. Even when I tried to disconnect the trigger box, the parallel port did not give any error message..

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