Howdy, Stranger!

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

Supported by

[solved] dportio.dll

edited February 2014 in OpenSesame

Hello guys

Now i am supposed to send triggers from opensesame to TCP client which port is 1024
the problem i am facing the connection between port either parallel or serial to TCP client

Firstly i tried to make bridge between the opnesesame and TCP client as it will read the port

Instead of using the parallel_port_trigger plug-in, it is also possible to send triggers with dlportio.dll through a Python inline script. This approach is Windows only. To do so, first add an inline_script to the start of the experiment with the following code in the prepare phase:

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

This will load dlportio.dll as a global object called io. Please note that failure will not crash the experiment, so make sure to check the debug window for error messages!

Now use the following code in an inline_script anywhere in the experiment to send a trigger:

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

I follow the steps and already installed in my PC
but when i am writing the first coode for importing dll as shown it gives me error in the syntax of the code in the prepare phase
Could any one know what is the trick here

Another solution : i tried to connect between virtual COM and TCP client but i find there is n't any software support this physical connection between virtual serial port and TCP client
so i think that d portio.dll could read the port of TCP client with out using any software for connection

Need suggestion for that !!!

Comments

  • edited February 2014

    If the first script doesn't run, this could be due to some unexpected indent. The correct syntax is as follows:

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

    Further potential issues:

    1. Have you installed the correct version of dlportio? For more information, see here, and have a look at this thread for instructions on how to install it on Windows 7.

    2. If I understand correctly, you're trying to access a emulated parallel port? If not, and you're trying to access the ethernet port, have a look at Python's socket module. You can find a nice code example here.

    Good luck!

  • edited 11:56PM

    Okay , thanks actually i solve the problem may be few hints may cause problem but
    now it work
    the problem in this line for understanding
    global io
    trigger = 1
    port = 1024

    here the port , actually the TCP client port is 1024 , so when i am writing the same port there is n't any connection

    so i am trying data stream bridge but also it can't read

    how can i link between TCP client port and dportio.dll?

  • edited 11:56PM

    https://wiki.python.org/moin/TcpCommunication

    how can i add TCP communication to python like pyserial communication

  • edited 11:56PM

    I'm afraid I don't really understand the question. I think the problem boils down to this: Either use dlportio.dll for parallel port communication, or use the socket module for ethernet communication. Don't try to use dlportio.dll for ethernet communication.

    In the example that I link to, the port number is defined in the variable TCP_PORT. Change that to whatever port number you need, and change the IP address to whatever IP you need.

    If you can't read what's coming back other the TCP connection, then just use the send method, not the recv.

    Good luck!

  • edited February 2014

    Thanks Edwin , Finally i made communication between opensesame and TCP client
    via this

    import socket
    import sys
    
    
    #create TCP/IP socket
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    
    
    #connect socket to the port 
    server_address = ('localhost', 10000)
    print >>sys.stderr, 'connecting to %s port %s' % server_address
    sock.connect(server_address)
    

    Now it receive communication thanks Edwin :)
    but i have a question about EEG channel location do u can help me in this

  • edited 11:56PM

    Good that you got it working! :)

    The last actual research I did with EEG was using Matlab and an obscure setup, and it was years ago. I have done a lot of teaching on the basics of the subject, but I am certainly no expert in the methods. So I'm afraid you'll have to look for help on the channel location elsewhere, e.g. with the company that provides you with the analysis software, of a colleague in the field.

    Good luck!

  • edited 11:56PM

    so , if i am asking about the physiology , i supposed simulate UAV operator stress
    so how can i make this experiment in opensesame

    Another question i need software for creating eeg montages i see CSD but it contains bugs , could u recommend me

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