\Inputs ^nosePoke = 1 \Outputs ^pellet = 3 ^pokeLight = 4 \Control variables VAR_ALIAS Number of Trials = A(0) \ Default = 10 VAR_ALIAS Length of Tone (ms) = A(1) \ Default = 50 ms VAR_ALIAS Tone Volume (dB) = A(2) \ Default = 80 dB VAR_ALIAS Rise/Fall Time (ms) = A(3) \ Default = 5 ms VAR_ALIAS Response Time (sec) = A(4) \ Default = 5 sec VAR_ALIAS Correct Tone Probability (%) = A(5) \ Default = 20% VAR_ALIAS Correct Tone (Hz) = A(6) \ Default = 2000 VAR_ALIAS Incorrect Tone (Hz) = A(7) \ Default = 1000 ^numOfTrials = 0 ^toneLength = 1 ^volume = 2 ^riseFall = 3 ^responseTime = 4 ^prob = 5 ^correctTone = 6 ^incorrectTone = 7 ^piProb = 8 \Data variables \B(0) = Total Correct Responses \B(1) = Total Incorrect Responses \B(2) = Total Omissions \B(3) = Total Premature Responses \B(4) = Total Rewards \Trial by trial data \B(I) = Trial number \B(I+1) = Which tone played - 1 = 1KHz, 2 = 2KHz \B(I+2) = Response time \B(I+3) = Omission = 1 in this position ^correctResp = 0 ^incorrectResp = 1 ^omissions = 2 ^premature = 3 ^rewards = 4 DIM A = 8 DIM B = 10000 \Working variables \List of ITI times LIST C = 6, 7, 8, 9, 10 \D = ITI selected from list C \E = Trial number \F = Response timer \I = B() index \Z-Pulses \Z1 = Start program \Z2 = End program \Z3 = Start go tone response timer \Z4 = Start no go tone response timer \Z5 = Issue pellet \Z6 = Correct response light timer \***************************************** \ Set up default values \***************************************** S.S.1, S1, 0.01": SET A(^numOfTrials) = 5, A(^toneLength) = 50, A(^volume) = 80; SET A(^riseFall) = 5, A(^responseTime) = 5, A(^prob) = 20; SET A(^correctTone) = 2000, A(^incorrectTone) = 1000; SET I = 5, E = 1, B(I) = -987.987 ---> S2 S2, #START: ~SetRack(MG, 1);~; \ The ANL-926 cards are in Rack 1 ~InitANL926;~; \ Reset ANL-926 ~SetAmp(MG, BOX, A[2]);~; \ Initialize Amplitude ~SetRF(MG, BOX, A[3]);~; \ Initialize Rise\Fall Time ~SetDur(MG, BOX, A[1]);~; \ Initialize Duration Z1; SET A(^piProb) = A(^prob) * 100 ---> SX \*************************************** \ Issue tones \*************************************** S.S.2, S1, #Z1: IF E > A(^numOfTrials) [@T, @F] @T: Z2 ---> S1 @F: ---> S2 S2, .01": WITHPI = A(^piProb) [@go, @noGo] \~20% chance of 2KHz tone @go: ~OnFreq(MG, BOX, A[6]);~; Z3; ON ^pokeLight; SET B(I) = E, B(I+1) = A(^correctTone), B(I+4) = -987.987 ---> S1 @noGo: ~OnFreq(MG, BOX, A[7]);~; Z4; ON ^pokeLight; SET B(I) = E, B(I+1) = A(^incorrectTone), B(I+4) = -987.987 ---> S1 \***************************************** \ Response timer \***************************************** S.S.3, S1, #Z3: ---> S2 #Z4: ---> S3 S2, \Record correct tone response time #R^nosePoke: SET B(I+2) = F, F = 0; ADD B(^correctResp); Z6; Z5; ADD B(^rewards); RANDI D = C ---> S4 \Go tone response timer 0.01": SET F = F + 0.01; SHOW 7, Response Timer, F; IF F >= A(^responseTime) [@T, @F] @T: ADD B(^omissions); SET F = 0; OFF ^pokeLight; RANDI D = C; SET B(I+3) = 1 ---> S4 @F: ---> SX S3, \Record incorrect tone response time #R^nosePoke: SET B(I+2) = F, F = 0; ADD B(^incorrectResp); OFF ^pokeLight; RANDI D = C ---> S4 \No go tone response timer 0.01": SET F = F + 0.01; SHOW 7, Response Timer, F; IF F >= A(^responseTime) [@T, @F] @T: ADD B(^omissions); SET F = 0; OFF ^pokeLight; RANDI D = C; SET B(I+3) = 1 ---> S4 @F: ---> SX S4, \Record premature responses during ITI #R^nosePoke: ADD B(^premature) ---> SX \ITI Timer 0.01": SET F = F + 0.01; SHOW 7, ITI Timer, F; IF F >= D [@T, @F] @T: ADD E; SET B(I+4) = 0, I = I + 5; Z1; SET F = 0; SET B(I) = -987.987---> S1 @F: ---> SX \*********************************************************** \ Keep the light on for 1 sec after correct tone response \*********************************************************** S.S.4, S1, #Z6: ---> S2 S2, 1": OFF ^pokeLight ---> S1 \******************************************** \ Pellet dispensing \******************************************** S.S.30, S1, #Z5: ON ^pellet ---> S2 S2, 0.5": OFF ^pellet ---> S1 \******************************************* \ Update the display \****************************************** S.S.31, S1, .5": SHOW 1, Trial Number, E, 2, Correct Responses, B(^correctResp); SHOW 3, Incorrect Responses, B(^incorrectResp), 4, Omissions, B(^omissions); SHOW 5, Premature Responses, B(^premature), 6, Rewards, B(^rewards) ---> SX \*************************************** \ End program \*************************************** S.S.32, S1, #Z2: ---> S2 S2, 1": ---> STOPABORTFLUSH