[solved] dportio.dll
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
If the first script doesn't run, this could be due to some unexpected indent. The correct syntax is as follows:
Further potential issues:
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.
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!
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?
https://wiki.python.org/moin/TcpCommunication
how can i add TCP communication to python like pyserial communication
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 therecv
.Good luck!
Thanks Edwin , Finally i made communication between opensesame and TCP client
via this
Now it receive communication thanks Edwin
but i have a question about EEG channel location do u can help me in this
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!
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