Howdy, Stranger!

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

Supported by

[open] EEG parallel port trigger for MAC

edited May 2014 in OpenSesame

Hi,

Opensesame is working like a charm for our behavioral studies, so now I would like to use it for our EEG (EGI system) experiments as well. Only the EGI system runs on a Mac, the computer for opensesame is windows operated.
The parallel port trigger plug-in available runs for windows only. Is there also a Mac compatible solution?

thank you,
Mona

Comments

  • edited 2:48PM

    Hi Mona,

    Actually, the parallel port plug-in works on Linux as well, using the parallel module (or an onboard modified version). This might just work on OS X, as the architecture is pretty similar. I don't have any experience on this, though (frankly, I didn't even know there are still Macs out there with a parallel port!).

    Good luck!

    Edwin

  • edited 2:48PM

    Dear Edwin,

    thank you for your reply. I see, for E-prime we created a new port specifically for Eprime in the network section of the Mac, but we used the Mac IP address for the configuration with Eprime on the PC. The opensesame parallel module is asking for a port (and obviously gives an error if I fill in the IP address of the Mac). How shall I best establish the connection?

    Our system (Mac EEG recording unit and windows pc on which the behavioral tasks are done) is sufficiently set up and connected, and I am familiar with setting up the configurations between both computers for Eprime, but I would like to introduce opensesame to our lab and for that I need to enable simultaneous EEG recording.

    As I see it, I need to add a port in the Mac to allow connection with opensesame (you have a default port name?) and need to allow opensesame to connect with the Mac with a similar module as the parallel except that it allows an IP input.

    Maybe this has been tried out before?

    thank you, Mona

  • edited 2:48PM

    Hi Mona,

    Some bad news, I'm afraid: I don't think anyone has used such a setup before, and I don't see a readymade solution.

    It sounds like it's configured via ethernet rather than via the parallel port. In any way, it's not going to be possible to establish a connection using the existing plug-ins. I would suggest either sticking with your current solution (without OpenSesame), running a virtual machine or native Windows installation (if you can configure your EEG equipment to work via Windows), or to use Python's socket module in an inline_script (see here for an example).

    If you manage to work something out, please do report back on the forum. Other might benefit :)

    Good luck!

  • edited 2:48PM

    Hi Mona,

    Edwin's right. What you're dealing with is not a parallel port, but an ethernet connection, and more specifically a UDP (datagram) connection. (Or at least I suspect that's what it is, there's a slight chance that it's TCP/IP.) It's not that hard to get this working though.

    Basically, you can create a socket at the start of your experiment with the script below. You need to specify the IP address of the Mac recorder computer. And in the Mac you need to indicate which you port you used (or change the port in the script to match the one specified in the Mac recorder computer).

    import socket
    # The IP address of the recorder PC
    ip = '127.0.0.1'
    # The communication port, which can probably be anything as long as it's
    # the same in OpenSesame and the recorder PC
    port = 40008
    # Initialize a socket object
    print('Opening socket')
    my_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    print('Socket opened on ip %s and port %d' % (ip, port))
    

    Once you've done this, you can send a trigger (I'm assuming a 0-255 byte trigger here, because that's what's usually done in EEG) with the following script:

    trigger_value = 255
    print('Sending trigger %d' % trigger_value)
    my_socket.sendto(chr(trigger_value), (ip, port))
    print('Trigger sent!')
    

    Something like this should do the trick. UDP communication is really not that hard, and you can read more about it here:

    Cheers!
    Sebastiaan

  • edited 2:48PM

    YES! thank you! that was the right direction! We managed to also get a 'start & stop EEG recording' impulse and triggers.

    As soon as it is a bit polished I will post it here in case anyone is in a similar position.

    Soon our whole lab will be geared up for open sesame! Thank you for this amazing program and your nice & fast responses!

    Mona

  • edited 2:48PM

    Soon our whole lab will be geared up for open sesame!

    Good to hear!

  • edited 2:48PM

    I actually found a whole website dedicated to EGI-netstation communication for future users:

    https://code.google.com/p/pynetstation/

    Enjoy! :)

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