Millisecond Forums

Sending signal to parallel port when responding

https://forums.millisecond.com/Topic26297.aspx

By Karoline - 1/27/2019

Hi,


in my experiment I've been using a n-back task and concurrently collecting physiological data via parallel ports. I'm trying to send a message to the parallel port when the subject is responding and have done this with the "response message attribute" until now. Furthermore on trial end I've send another signal, which sets the biomarker back to zero. In the following a short extract from my code:

<port lpt_000>
/ port = LPT1
/ subport = data
/ items = ("00000000")
</port>

<port lpt_006>
/ port = LPT1
/ subport = data
/ items = ("00000110")
</port>

<port lpt_007>
/ port = LPT1
/ subport = data
/ items = ("00000111")
</port>

<trial target_1>
/ stimulustimes = [0 = targetword_1, lpt_006; 500 = eraser]
/ validresponse = (noresponse, 30)
/ correctresponse = (30)
/ responsemessage = (" ", lpt_007, 0)
/ ontrialbegin = [
{if (values.N == 1) values.currenttarget = values.minus1};
{if (values.N == 2) values.currenttarget = values.minus2};
{if (values.N == 3) values.currenttarget = values.minus3};
]

/ ontrialend = [
values.minus3 = values.minus2;
values.minus2 = values.minus1;
values.minus1 = text.targetword_1.currentitemnumber;
values.Hits_1 = values.Hits_1 + trial.target_1.correct;
values.Misses_1 = values.Misses_1 + trial.target_1.error;
values.TotalHits_1 = values.TotalHits_1 + trial.target_1.correct;
values.DV_1 = (values.TotalHits_1 - values.TotalFA_1)/values.TotalBlocks_1;
]
/ ontrialend = [lpt_000]
/ responsetime = 0
/ trialduration = values.trialduration
</trial>

Looking at my data, I've seen that, although the subject is reacting, the signal hasn't been send to the parallel port. Instead, the biomarker is set to zero. I guess that the problem is, that the trial ends when the person reacts and that only one signal can be transmitted ("response message-signal" or "trialend-signal"). Is there any possibility to send both signals? How do I have to change my code to do that?

Any help will be very much appreciated.

Thanks in advance!

Karoline
By Dave - 1/27/2019

Karoline - Monday, January 28, 2019
Hi,


in my experiment I've been using a n-back task and concurrently collecting physiological data via parallel ports. I'm trying to send a message to the parallel port when the subject is responding and have done this with the "response message attribute" until now. Furthermore on trial end I've send another signal, which sets the biomarker back to zero. In the following a short extract from my code:

<port lpt_000>
/ port = LPT1
/ subport = data
/ items = ("00000000")
</port>

<port lpt_006>
/ port = LPT1
/ subport = data
/ items = ("00000110")
</port>

<port lpt_007>
/ port = LPT1
/ subport = data
/ items = ("00000111")
</port>

<trial target_1>
/ stimulustimes = [0 = targetword_1, lpt_006; 500 = eraser]
/ validresponse = (noresponse, 30)
/ correctresponse = (30)
/ responsemessage = (" ", lpt_007, 0)
/ ontrialbegin = [
{if (values.N == 1) values.currenttarget = values.minus1};
{if (values.N == 2) values.currenttarget = values.minus2};
{if (values.N == 3) values.currenttarget = values.minus3};
]

/ ontrialend = [
values.minus3 = values.minus2;
values.minus2 = values.minus1;
values.minus1 = text.targetword_1.currentitemnumber;
values.Hits_1 = values.Hits_1 + trial.target_1.correct;
values.Misses_1 = values.Misses_1 + trial.target_1.error;
values.TotalHits_1 = values.TotalHits_1 + trial.target_1.correct;
values.DV_1 = (values.TotalHits_1 - values.TotalFA_1)/values.TotalBlocks_1;
]
/ ontrialend = [lpt_000]
/ responsetime = 0
/ trialduration = values.trialduration
</trial>

Looking at my data, I've seen that, although the subject is reacting, the signal hasn't been send to the parallel port. Instead, the biomarker is set to zero. I guess that the problem is, that the trial ends when the person reacts and that only one signal can be transmitted ("response message-signal" or "trialend-signal"). Is there any possibility to send both signals? How do I have to change my code to do that?

Any help will be very much appreciated.

Thanks in advance!

Karoline

You cannot "send" a signal /ontrialend. /ontrialend executes logic, it is not capable of displaying any stimuli, including <port> elements. To send "both" signals you'd have to /branch to a separate <trial> element that displays the lpt_000 stimulus as usual, per its /stimulustimes or -frames.
By Karoline - 1/29/2019

Dave - Monday, January 28, 2019
Karoline - Monday, January 28, 2019
Hi,


in my experiment I've been using a n-back task and concurrently collecting physiological data via parallel ports. I'm trying to send a message to the parallel port when the subject is responding and have done this with the "response message attribute" until now. Furthermore on trial end I've send another signal, which sets the biomarker back to zero. In the following a short extract from my code:

<port lpt_000>
/ port = LPT1
/ subport = data
/ items = ("00000000")
</port>

<port lpt_006>
/ port = LPT1
/ subport = data
/ items = ("00000110")
</port>

<port lpt_007>
/ port = LPT1
/ subport = data
/ items = ("00000111")
</port>

<trial target_1>
/ stimulustimes = [0 = targetword_1, lpt_006; 500 = eraser]
/ validresponse = (noresponse, 30)
/ correctresponse = (30)
/ responsemessage = (" ", lpt_007, 0)
/ ontrialbegin = [
{if (values.N == 1) values.currenttarget = values.minus1};
{if (values.N == 2) values.currenttarget = values.minus2};
{if (values.N == 3) values.currenttarget = values.minus3};
]

/ ontrialend = [
values.minus3 = values.minus2;
values.minus2 = values.minus1;
values.minus1 = text.targetword_1.currentitemnumber;
values.Hits_1 = values.Hits_1 + trial.target_1.correct;
values.Misses_1 = values.Misses_1 + trial.target_1.error;
values.TotalHits_1 = values.TotalHits_1 + trial.target_1.correct;
values.DV_1 = (values.TotalHits_1 - values.TotalFA_1)/values.TotalBlocks_1;
]
/ ontrialend = [lpt_000]
/ responsetime = 0
/ trialduration = values.trialduration
</trial>

Looking at my data, I've seen that, although the subject is reacting, the signal hasn't been send to the parallel port. Instead, the biomarker is set to zero. I guess that the problem is, that the trial ends when the person reacts and that only one signal can be transmitted ("response message-signal" or "trialend-signal"). Is there any possibility to send both signals? How do I have to change my code to do that?

Any help will be very much appreciated.

Thanks in advance!

Karoline

You cannot "send" a signal /ontrialend. /ontrialend executes logic, it is not capable of displaying any stimuli, including <port> elements. To send "both" signals you'd have to /branch to a separate <trial> element that displays the lpt_000 stimulus as usual, per its /stimulustimes or -frames.

Ok, thank you for your answer! That helped quite a lot :)