<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
.ExternalClass EC_p.MsoNormal, .ExternalClass EC_li.MsoNormal, .ExternalClass EC_div.MsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman';}
.ExternalClass EC_a:link, .ExternalClass EC_span.MsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass EC_a:visited, .ExternalClass EC_span.MsoHyperlinkFollowed
{color:blue;text-decoration:underline;}
.ExternalClass EC_span.E-MailFormatvorlage19
{font-family:Arial;color:navy;}
.ExternalClass EC_div.Section1
{page:Section1;}

 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.ecmsonormal, li.ecmsonormal, div.ecmsonormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.E-MailFormatvorlage19
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=DE link=blue vlink=blue>

<div class=Section1>

<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Dear E-prime list,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Almost a month has passed
since my last e-mail and I am still having problems with the timing in my
experiment, despite the excellent help from Paul Groot, and I am now pretty
close to (if not already past) total desperation. I am sorry to have to keep
bothering this list, but I am completely out of ideas regarding how to solve my
problem.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>I am presenting a
targetstimulus (mainstimulus) at a duration determined in a preceding titration
block followed by a maskstimulus (mainmask2). I want to simultaneously repeatedly
trigger a TMS stimulator via the parallel port. So trigger pulses are sent both
during presentation of the targetstimulus and the maskstimulus, with
subsequently 2 keyboard responses collected during the maskstimulus. How many
trigger pulses are sent during the targetstimulus (and thereby how many during
the maskstimulus) is determined by the stimulus duration. In total, 5 trigger
pulses are sent, one every 40ms, starting at targetstimulus onset.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>The experiment (inline code
attached at the end of this email, works together with stimdisplay objects for
both targetstimulus and maskstimulus under unreferenced objects) is mostly
working apart from one persistent problem that I cannot seem to get rid of; the
maskstimulus onset is consistently delayed by approximately 2 screen refresh
durations. The main problematic consequence of this delay is that TMS trigger
pulses falling in this delay, are also delayed meaning the time between
successive TMS pulses is no longer constant. I have tried both approaches
suggested by Paul in his previous email; duration = pre-release = 0 and
duration = pre-release = targetstimulus duration. Regardless of how I combine
durations and pre-release, the onset of the maskstimulus (and thereby the
offset of the targetstimulus) is consistently delayed by about 2 screen refresh
durations. Unfortunately, in this experiment both the presentation duration of
the targetstimulus and the timing of the TMS pulses are critical.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>As mentioned previously,
the results from the clocktest show that my computer is capable of millisecond
precision. Moreover, during the stimulus duration titration block (which is
identical to the experimental block apart from the TMS pulses) I have
millisecond timing precision.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Does anybody have any
idea of something else that I could try to get rid of the timing delay of the
maskstimulus? Any help would, as always, be greatly appreciated.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Many thanks in advance,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Bianca de Haan<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>############################################################################################################<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>'SCRIPT TO ENABLE TMS PULSES FROM TARGET STIMULUS ONSET<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        'create pulsecount to
keep track of the amount of pulses fired<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        PulseCount = 0<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        'Prepare things so that
first TMS pulse is sent at stimulus onset<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        mainstimulus.OnsetSignalEnabled
= True<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        mainstimulus.OnsetSignalPort
= &H378<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        mainstimulus.OnsetSignalData
= &HFF<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        'Prepare and run
mainstimulus<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        </span></font><font
size=2 color=navy face=Arial><span lang=FR style='font-size:10.0pt;font-family:
Arial;color:navy'>mainstimulus.Duration = StimDisplayDuration<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=FR style='font-size:10.0pt;font-family:Arial;color:navy'>        mainstimulus.PreRelease
= mainstimulus.Duration<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=FR style='font-size:10.0pt;font-family:Arial;color:navy'>        mainstimulus.Filename
= c.GetAttrib("mainstimulus")<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=FR style='font-size:10.0pt;font-family:Arial;color:navy'>        mainstimulus.Load<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=FR style='font-size:10.0pt;font-family:Arial;color:navy'>        mainstimulus.Run<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=FR style='font-size:10.0pt;font-family:Arial;color:navy'>        c.SetAttrib
"mainstimulus.OnsetDelay", mainstimulus.OnsetDelay<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=FR style='font-size:10.0pt;font-family:Arial;color:navy'>        c.SetAttrib
"mainstimulus.OnsetTime", mainstimulus.OnsetTime<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=FR style='font-size:10.0pt;font-family:Arial;color:navy'>        </span></font><font
size=2 color=navy face=Arial><span lang=EN-GB style='font-size:10.0pt;
font-family:Arial;color:navy'>c.SetAttrib "mainstimulus.PreRelease",
mainstimulus.PreRelease<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        MainStimOnset =
mainstimulus.OnsetTime <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        PulseCount = PulseCount
+ 1<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        'make sure exact
vertical refresh is hit<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        sleep (0.5 *
RefreshDuration)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        'keep mainstimulus
onscreen until stimdisplayduration has elapsed<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        while clock.read() <
MainStimOnset + StimDisplayDuration - (0.5 * RefreshDuration)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    'as
long as stimdisplayduration has not elapsed, trigger tms every 40ms<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    PulseTime
= MainStimOnset + ((5 * PulseCount) * RefreshDuration)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    PulseWait
= PulseTime - clock.read()<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    WritePort
&H378,0<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    if
PulseWait <= 0 then <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    WritePort
&H378,255<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    PulseCount
= PulseCount + 1<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    c.SetAttrib
"PulseTime" & PulseCount, clock.read()<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    end
if<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        wend<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        do<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        loop until clock.read()
>= MainStimOnset + StimDisplayDuration - (0.5 * RefreshDuration)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        'Prepare and run
mainmask2<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        mainmask2.InputMasks.Reset<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        mainmask2EchoClients.RemoveAll<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        mainmask2.InputMasks.Add
Keyboard.CreateInputMask("{ANY}", "", CLng("-1"),
CLng("2"), ebEndResponseActionNone, CLogical("Yes"),
"", "", "ResponseMode:All ProcessBackspace:Yes")<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        mainmask2.Duration =
StimDisplayDuration<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        mainmask2.PreRelease =
mainmask2.Duration<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        mainmask2.Run<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        'start loop that runs
mainmask2 until 2 responses are collected while firing <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        'remaining tms pulses<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        Dim StimDisplayMasks As
InputMaskManager<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        Set StimDisplayMasks =
mainmask2.InputMasks<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        while PulseCount < 5
And StimDisplayMasks.Item(1).Responses.Count < 2<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    PulseTime
= MainStimOnset + ((5 * PulseCount) * RefreshDuration)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    PulseWait
= PulseTime - clock.read()<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    WritePort
&H378,0<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    if
PulseWait <= 0 then <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    WritePort
&H378,255<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    PulseCount
= PulseCount + 1<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    c.SetAttrib
"PulseTime" & PulseCount, clock.read()<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>                    end
if<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        wend<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        do<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        loop until
StimDisplayMasks.Item(1).Responses.Count = 2<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        'save attributes
mainmask2<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        c.SetAttrib
"resp1", StimDisplayMasks.Item(1).Responses(1).RESP<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        c.SetAttrib
"resp2", StimDisplayMasks.Item(1).Responses(2).RESP<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        c.SetAttrib
"mainmask2.OnsetDelay", mainmask2.OnsetDelay<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        c.SetAttrib
"mainmask2.OnsetTime", mainmask2.OnsetTime<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        c.SetAttrib
"mainmask2.RESP", mainmask2.RESP<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        'calculate real
mainstimulus duration<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        RealTargetDuration =
mainmask2.Onsettime - mainstimulus.OnsetTime<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'>        c.SetAttrib
"RealTargetDuration", RealTargetDuration<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:5.25pt'><font size=2 color=navy
face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>

</div>

</div>

</body>

</html>