Com Port Signal


Author
Message
wal
wal
Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)
Group: Forum Members
Posts: 4, Visits: 24
Hi guys,

I bashed my head against a little problem and would appreciate your help. 

I have a Varioport (tool to measure eda) which is connected  to my pc via comport. All I want to do is to send signals from Inquisit and through the comport. It doesn´t have to be an elaborate signal. I just need a beep, blip or whatever. After I got everything working, I can´t figure out, what signal to send or how to send a signal. I know Inquisit can communicate with the varioport tool, because at the beginning and at the end of the experiment Inquisit sends an automatic signal though the comport.
Can you tell me what kind of signal Inquisit sends automatically or how I can send a comparable signal?

This is a snippet if the code I´m using right now:

<port comporton>
/ items = ("00001000") **I tried various combinations here. 
/ port = COM2
</port>

<port comportoff>
/ items = ("00000000")
/ port = COM2
</port>

<trial porttesttrial>
/ trialduration = 1000
/ posttrialpause = 500
/ stimulustimes = [1= comporton, square_yellowg]
/ontrialend = [port.comportoff]
</trial>

<page porttestgo>
Porttest
</page>


<block Porttest>
/trials = [1-5=porttesttrial]
/ preinstructions =(porttestgo)
</block>

Thanks for your help in advance!
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
wal - Monday, May 15, 2017
Hi guys,

I bashed my head against a little problem and would appreciate your help. 

I have a Varioport (tool to measure eda) which is connected  to my pc via comport. All I want to do is to send signals from Inquisit and through the comport. It doesn´t have to be an elaborate signal. I just need a beep, blip or whatever. After I got everything working, I can´t figure out, what signal to send or how to send a signal. I know Inquisit can communicate with the varioport tool, because at the beginning and at the end of the experiment Inquisit sends an automatic signal though the comport.
Can you tell me what kind of signal Inquisit sends automatically or how I can send a comparable signal?

This is a snippet if the code I´m using right now:

<port comporton>
/ items = ("00001000") **I tried various combinations here. 
/ port = COM2
</port>

<port comportoff>
/ items = ("00000000")
/ port = COM2
</port>

<trial porttesttrial>
/ trialduration = 1000
/ posttrialpause = 500
/ stimulustimes = [1= comporton, square_yellowg]
/ontrialend = [port.comportoff]
</trial>

<page porttestgo>
Porttest
</page>


<block Porttest>
/trials = [1-5=porttesttrial]
/ preinstructions =(porttestgo)
</block>

Thanks for your help in advance!


<trial porttesttrial>
/ trialduration = 1000
/ posttrialpause = 500
/ stimulustimes = [1= comporton, square_yellowg]
/ontrialend = [port.comportoff]
</trial>

You can't "send" a port signal via /ontrialend. The trial should read something like

<trial porttesttrial>
/ trialduration = 1000
/ posttrialpause = 500
/ stimulustimes = [0= comporton, square_yellowg; 100=comportoff]
</trial>

This would raise the signal at the start of the trial, and "turn it off" again after 100ms.


wal
wal
Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)
Group: Forum Members
Posts: 4, Visits: 24
Hey Dave thanks for the quick answer and the quick code fix. Sadly I still got the problem and there is no handbook or community for hardware I´m using. 
Thats why I keep asking you.
Comporton and Comport off don´t register at the varioport. It doesn´t matter if I send 8 (00001000), 16 (0001000) or some other 8bit sequence.

I know Inquisit can send signals to Varioport because the start and the end of an experiment registers as a signal. The signal does not register when I change
the port (to COM1) in comporton and comportoff. Which means it is not a random signal Inquisit sends. Do you know what kind of signal Inquisit sends at the beginning and end of an experiment?
Is it an 8-bit sequence I can send using  <port comporton>?


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
wal - Tuesday, May 16, 2017
Hey Dave thanks for the quick answer and the quick code fix. Sadly I still got the problem and there is no handbook or community for hardware I´m using. 
Thats why I keep asking you.
Comporton and Comport off don´t register at the varioport. It doesn´t matter if I send 8 (00001000), 16 (0001000) or some other 8bit sequence.

I know Inquisit can send signals to Varioport because the start and the end of an experiment registers as a signal. The signal does not register when I change
the port (to COM1) in comporton and comportoff. Which means it is not a random signal Inquisit sends. Do you know what kind of signal Inquisit sends at the beginning and end of an experiment?
Is it an 8-bit sequence I can send using  <port comporton>?


To the best of my knowledge, Inquisit doesn't send any specific signal at the start and/or end of the experiment. My guess would be that what you're registering is some kind of artifact related to the initialization of the varioport or its driver. What you can do to (try) and figure out the right settings is use the Serial Port Monitor (Tools -> Serial Port Monitor).

And yes, what a <port> element sends is an 8-bit TTL signals which you can express in either binary or as an integer: https://www.millisecond.com/support/docs/v4/html/language/elements/port.htm

As for what signals the Varioport expects or needs (some devices need to receive a specific signal to "initialize"), that should be covered in the Varioport's documentation.

Hope this helps.

wal
wal
Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)Respected Member (412 reputation)
Group: Forum Members
Posts: 4, Visits: 24
Okay I solved it. First of all thank you very much for your help and your quick answers Dave!

Since I use the forum regularly to solve problems, I wanted to provide a solution myself. So for everyone who has this or a similar problem. 
I tried to commuinicated with the Varioport through the serial/com port. I could measure lets call it a blip at the start and the end of the experiment, but wasn´t able to send any signals with Inquisit myself.
What you have to do to communicate with Varioport, if it is hooked to the serial/com port, is to initialise or deactivate the port. Inquisit simply can´t do that on command, but does it very shortly at the start or end of the experiment. Hence the measured blip.
If you have to use the com/serial port its easy to do in matlab just initialse the port and fopen/fclose it.  

In Inquisit you´ll have to use the LTP port. Here a snippet of my code

<port ltpmax>
/ port = LPT1
/ subport = data
/ items = ("11111111")
</port>

<port ltphalf>
/ port = LPT1
/ subport = data
/ items = ("10000000")
</port>

<port ltpoff>
/ port = LPT1
/ subport = data
/ items = ("00000001")
</port>

**This is taken from one of the Stroops provided by Millisecond
<trial tg_neu_gel>   
/ pretrialpause = 0
/ validkeys = ("f", "v", " ", "j", "n")
/ correctresponse = ("v")
/ stimulustimes = [1= ltpmax, square_gelbg; 2=g_neu] **First signal with max output at the first stimulus (255)
/ posttrialpause = 40
/ responsemessage = (" ", ltphalf, 1) **Now, without the " " empty answer, it would not let me send the ltphalf signal with 1ms duration. (Flying blind here. Can´t do a test run right now, at least Inquisit doesn´t complain about this. So this may be wrong. ). But still on response a second signal half as strong as the first one (128).
/ ontrialend = [ltpoff] **Keep this in mind http://www.millisecond.com/support/docs/v5/html/howto/howtocontroltiming.htm . The signal will be send after the posttrailpause. Last signal at the end of the trial (1). 
</trial>

Hope this helps someone.

   
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search