Millisecond Forums

Problems sending responsemessage to eeg

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

By july1810 - 6/16/2015

Hi there,
the thing is, that the response message is not send, because the values I'm calling or the way I'm calling them does not work. I would really appreciate your help. Please find my code below.
Thank you.
Julia

<port signal_response_correct>
/ port = LPT1
/ subport = data
/ items = ("00000011")
</port>

<trial block1_congruent>
/ontrialbegin = [values.iti_congruent = list.iti_congruent.nextvalue]
/ontrialbegin = [if (list.congruent.currentvalue == 1) values.correctresponse = "25" else values.correctresponse = "16"]
/ontrialbegin = [if (list.congruent.currentvalue == 1) values.errorresponse = "16" else values.errorresponse = "25"]

/stimulustimes = [0 = outerbox_black, innerbox, flanker1_congruent, flanker2_congruent, target_congruent, flanker3_congruent, flanker4_congruent, signal_cond_congruent; 200 = blankscreen]
/validresponse = (16, 25)
/iscorrectresponse = [if (values.correctresponse == 25) trial.block1_congruent.response == 25 else trial.block1_congruent.response == 16]
/responsemessage = (values.correctresponse, signal_response_correct, 0)
/responsemessage = (values.errorresponse, signal_response_error, 0)
/responseinterrupt = trial
/trialduration = values.iti_congruent

/ontrialend = [if (trial.block1_congruent.correct == true) values.block1_correct_congruent +=1]
/ontrialend = [if (trial.block1_congruent.correct == false) values.block1_error_congruent +=1]
/ontrialend = [if (trial.block1_congruent.correct == true) values.block1_reactime_congruent_correct +=trial.block1_congruent.latency]
/ontrialend = [if (trial.block1_congruent.correct == false) values.block1_reactime_congruent_error +=trial.block1_congruent.latency]
/ontrialend = [if (trial.block1_congruent.timeout == true) values.block1_miss_congruent +=1]
</trial>

By Dave - 6/16/2015

#1: It looks like you also present <port> stimuli via the /stimulustimes attribute. You *must* make sure to also reset all those raised bits to zero after a short amount of time in /stimulustimes. Otherwise the signal will *remain raised* and mask the <port> signals you are trying to send via /responsemessage. See e.g. this example:

https://www.millisecond.com/forums/FindPost15055.aspx

#2: You should set a sufficient minimum duration in your /responsemessage attributes. Otherwise the signal may not be raised long enough for your external equipment to detect it.

/responsemessage = (values.correctresponse, signal_response_correct, 0)

#3: Also, the syntax in your /responsemessage attributes is wrong. You cannot use variables in it:

/responsemessage = (values.correctresponse, signal_response_correct, 0)

The right thing to do is to use the /correct- and /errormessage attributes instead. I.e.

<trial block1_congruent>
...
/responsemessage = (values.correctresponse, signal_response_correct, 0)
/responsemessage = (values.errorresponse, signal_response_error, 0)

/ correctmessage = (signal_response_correct, 100)
/ errormessage = (signal_response_error, 100)
/responseinterrupt = trial
/trialduration = values.iti_congruent

...
</trial>
By july1810 - 6/17/2015

Thank you very much. It works fine now =)