Triggering the No/Go response on inline

84 views
Skip to first unread message

Enrico Fattorini

unread,
Jun 23, 2014, 12:28:25 PM6/23/14
to e-p...@googlegroups.com
Hi to everyone,

I am using E-Prime 1. I am now preparing a Go/NoGo paradigm. I have a problem about the triggering of the No/Go response on the inline file. I have three response conditions: response with left hand ("s"); response with right hand ("l"); NO response. I did not have problem to trigger the two Go responses (letter "s" and "l") but the software is closing and segnaling an error when I did not make a response. I have to find the way to triggering a NO response.

I tried a lot of different combinations, one is the following:

if TResp.Responses(TResp.Responses.count).resp= "s" then
Trisp=1 
elseif TResp.Responses(TResp.Responses.count).resp= "l" then
Trisp=2
elseif TResp.Responses(TResp.Responses.count).resp= "void" then
Trisp=3
end if

if Trisp = 1 then 
writeport 888, 51
sleep 5
writeport 888, 0

elseif Trisp = 2 then
writeport 888, 52
sleep 5
writeport 888, 0

elseif Trisp = 3 then
writeport 888, 50
sleep 5
writeport 888, 0

Any suggestions?

Thank you a lot.

Enrico

Paul Groot

unread,
Jun 24, 2014, 9:45:35 AM6/24/14
to e-p...@googlegroups.com
Hi Enrico,

Does your paradigm really allow multiple responses on a single stimulus? Your script checks the value of the latest response, which would be over-complicated in case the maximum number of allowed responses is 1. Also, if there are no responses, your script will fail because it tries to read the value of the last element of the response array, which will not exist if there are no elements! So, to simplify the script you should use TResp.RESP instead of TResp.Responses(TResp.Responses.count).resp.

Also be aware that comparison will be case sensitive. And instead of using if-then, you could use Select-Case. Combining it all together:

Select Case UCase$(TResp.RESP)
Case "S"
Trisp=1 
Case "L"
Trisp=2 
Case ""
Trisp=3 
Otherwise
Debug.Print "Unexpected reponse: " & TResp.RESP
End Select


Or combining the other lines as well:

Dim code as Integer

Select Case UCase$(TResp.RESP)
Case "S"
code = 51
Case "L"
code = 52
Case ""
code = 50
Otherwise
Debug.Print "Unexpected reponse: " & TResp.RESP
        code = 0
End Select

if code>0 then
   writeport 888, code
   sleep 5
   writeport 888, 0
end if

Best
Paul

PS. Note that nonzero pre-release times will be problematic if this inline is used immediately after TResp.





--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+u...@googlegroups.com.
To post to this group, send email to e-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/836c0a8c-6e89-48ab-90fd-f31ad7a9894f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages