\\\\\\\\\\ Summary of Task \\\\\\\\\\ \ 3-choice serial reaction time task \ Animals are required to make a nose-poke response into the flashed hole to get a food pellet. \\\\\\\\\\ Inputs and Outputs \\\\\\\\\\ \Inputs \#R4 = Nosepoking to the left hole \#R5 = Nosepoking to the center hole \#R6 = Nosepoking to the right hole \#R10 = Nosepoking to the food magazine \Outputs ^FeederLight = 10 ^HouseLight = 11 ^Pellet = 12 \NOTE: Numbers of inputs and outputs depends on your wiring. \\\\\\\\\\ Z-Pulses \\\\\\\\\\ \ z1 = Signal to Deliver a Food Pellet \ z2 = Signal of Session End \ z3 = Signal of Magazine Entry \ z4 = Signal of Correct Response \ z5 = (Not used in this program) \ z6 = Signal of Starting New Trial \ z7 = Signal of Omission (No Response to the Holes) \ z8 = Signal to Flash Magazine Light \ z9 = Signal of Incorrect Response \ z10 = Signal of Finishing Time-Out \ z11 = Signal of Starting 3-Choice Period \ z12 = Signal of Perseverative Response \ z13 = Signal of Premature Response \\\\\\\\\\ Control Variables \\\\\\\\\\ \ D = Time for checking the number of trial, \ L = Limited Hold, 60 s \ I = Inter Trial Interval, 5 s \ O = Time-Out Period, 5 s \ Q = Stimulus Duration, 1 s \ T = Max number of trials, 100 trial \ E = Time length of a session, 60 min, Screen Label "EXP-TIM" \\\\\\\\\\ Data Variables \\\\\\\\\\ \ a(j+x): Data for Each Trial \ a(j+0) = Each Trial Number \ a(j+1) = Reward Latency for Each Trial \ a(j+2) = Correct Response Latency for Each Trial \ a(j+3) = Hole Number of Nosepoke Response for Each Trial,4,5,6 \ a(j+4) = Omission Error Tag (No response), 99 \ a(j+5) = Incorrect Response Tag, 1 \ a(j+6) = NosePoke Correct Response Number 4,5,6, randomly assigned for each trial \ a(j+7) = Premature Response for Each Trial \ a(j+8) = Responses during Time-Out(incorrect, omission, and perseverative responses) for Each Trial \ a(j+9) = Perseverative Response Tag, 1 \ a(j+10) = Incorrect Response Latency for Each Trial \ a(j+11) = Responses during Time-Out(premature response) for Each Trial \ b(x): Data for a Session \ b(0) = Total Number of Trials \ b(1) = Sum of Reward Latency \ b(2) = Average of Reward Latency \ b(3) = The Number of Magazine Entry After Correct Response \ b(4) = Sum of Correct Response Latency \ b(5) = Average of Correct Response Latency \ b(6) = The Number of Correct Response \ b(7) = The Number of Omission \ b(8) = The Number of Premature Response \ b(9) = The Number of Time-Out Response During Premature Response-Induced Time-Out \ b(10) = The Number of Incorrect Response \ b(11)= Sum of Incorrect Response Latency \ b(12)= The Number of Perseverative Response \ b(13)= The Number of Time-Out Response During Incorrect, Omission, and Perseverative Response-Induced Time-Out \ b(14)= Average of Incorrect Response Latency \ W(x) = Work Array, No Recording \ w(0) : Clock for Elapsed Time, Minutes (from w(1)) \ w(1) : Clock for Elapsed Time, Seconds \ w(2) : Clock for Reward Latency, Seconds \ w(3) : Clock for Correct Response Latency, Seconds \ w(4) : The Number of Flash \\\\\\\\\\ Array and Data Format \\\\\\\\\\ DIM A = 1320 \Data for each trial DIM B = 15 \Data for total trials DIM W = 5 \Work array, no recording LIST X=4,5,6 \To randomly illuminate a hole light DISKVARS = a,b,c DISKFORMAT = 6.2 DISKCOLUMNS = 12 DISKOPTIONS= FULLHEADERS \****************************** < Procedure > ****************************** S.S.1, \====================[ Main ]==================== s1, \ Set Default Values of Control Variables 0.01": set D= 0.5", L= 6", I= 5", O= 5", Q= 1", T= 100, E= 60--->s2 \D=Checking Time, L=Limited Hold, I=ITI time, O=Time-Out, Q= Stimulus Duration, T= Max Trials, E=Session Time s2, \ Wait Start Command #START:--->s3 s3, \ First food delivery to motivate an animal 1":z1--->s8 s4, \ New Trial Start 0.1":add b(0);set a(j+0)=b(0);z6--->s5 \ After 0.1 s, Trial No +1, record it and Send Start Signal (z6). s5, \ Inter Trial Interval (ITI) #z13:--->s10 \ When Signal of Premature Response(z13) comes, go to Time Out. I#T:z11--->s6 \ ITI Passed, z11=Start 3-Choice Period #z2:--->s32 \ When Session End Singal(z2) comes, go to End Process. s6, \ 3-Choice Period L#T:z7--->s7 \ After the limited hold (L:6 s), send omission signal (z7), and go to Time-Out. #z4:--->s8 \ When correct response singal(z4) comes, go to next. #z9:--->s7 \ When incorrect response signal(z9) comes, go to Time-Out. #z2:--->s32 s7, \ Time-Out Due to InCorrect, Omission, or Perseverative Response O#T:z10--->s9 \ Time Out Period Passed, z10=Finish Time-Out. s8, \ Waiting for food collect #z3:--->s9 \ When Signal of Magazine Entry(z3) comes, go to next trial. #z12:--->s7 #z2:--->s32 s9, \ Check the Number of Trials D#T:if b(0) >= T [@End,@Continue] \ Max number of trials? @E:z2--->s32 \ If it is true, send End signal(z2) and go to End Process. @C:set j=j+12;RANDD a(j+6)=X;z8--->s12 \ If it is NOT true, change the row of data(j=j+11), randomly assign correct hole, and send Signal to Flash Magazine Light(z8). #z2:--->s32 s10, \ Time Out Due to Premature Response O#T:z10;z8--->s11 \ Time Out Period Passed, z10=Finish Time Out, z8=Flash Magazine Light. #z2:--->s32 s11, \ Waiting for magazine entry to Restart (Premature Response) #z3:--->s5 #z2:--->s32 s12, \ Waiting for magazine entry to Start next trial #z3:--->s4 #z2:--->s32 s32, \ End Process 0.01":set a(j+13)=-987.987--->sx \ Seal an array S.S.2, \ Check Elapsed Time ------------------------------------------------ s1, \ Wait Start Command #Start:--->s2 s2, \ Wait Session Start #z6:--->s3 \ When Signal of Starting New Trial comes (z6), start timer. s3, \ Timer of Elapsed Time 1":add w(1); \ Every 1 s, w(1) +1. if w(1) >=60 [@True,@False] \ 60 s passed? @T:set w(1)=0;add w(0); \ If 60 s passed, reset counter, min + 1. if w(0) >=E [@True,@False] \ Elapsed time is larger than the time length of a session? @T:z2--->s32 \ If it is true, send End signal(z2) and go to End Process. @F:--->sx \ If it is NOT true, continue. @F:--->sx #z2:--->s32 s32,\ End Process 0.01":--->sx S.S.3, \ Wait for Animal Responses ------------------------------------------------------ s1, \ Wait Start Command #Start:--->s2 s2, \ Wait First Food Delivery #z1:--->s10 s3, \ Wait the Start of New Trial #z6:--->s4 \ When Start Singal(z6) comes, go to next State. #z2:--->s32 \ When Session End Singal(z2) comes, go to End Process. s4, \ Inter Trial Interval (ITI) #z11:--->s5 \ Begin 3-Choice period #R4 ! #R5 ! #R6:add a(j+7),b(8);z13--->s8 \ Premature Response #z2:--->s32 s5, \ 3-Choice Period #R a(j+6):set a(j+3)=a(j+6);add b(6);z1;z4--->s6 \Correct Response #R4:set a(j+3)=4;add a(j+5), b(10);z9--->s7 \Incorrect Response #R5:set a(j+3)=5;add a(j+5), b(10);z9--->s7 #R6:set a(j+3)=6;add a(j+5), b(10);z9--->s7 #z7:set a(j+4)=99;add b(7)--->s7 \ When Omission Signal(z7) comes, record it and go to next. #z2:--->s32 s6, \ Waiting for collecting food after Correct Response #R10:z3--->s11 #R4 ! #R5 ! #R6:add a(j+9),b(12);z12--->s7 \ Persevertive Response #z2:--->s32 s7, \ Time-Out Due to Incorrect response, Omission, or Perseverative Response #z10:--->s11 \ z10 = Signal of Finishing Time-Out #R4 ! #R5 ! #R6:add a(j+8),b(13)--->sx #z2:--->s32 s8, \ Time-Out Due to Premature Response #z10:--->s9 \ z10 = Signal of Finishing Time-Out #R4 ! #R5 ! #R6:add a(j+11),b(9)--->sx #z2:--->s32 s9, \ Waiting for magazine entry after finishing time-out due to Premature Response #R10:z3--->s4 s10, \ Waiting for collecting food after First Food Delivery #R10:z3--->s11 \ When an animal nosepokes to the food magazine, send Signal of Magazine Entry(z3). #z2:--->s32 s11, \ Waiting for checking the number of trials #z8:--->s12 \ When Signal to Flash Magazine Light comes (z8), go to next. #z2:--->s32 s12, \ Checking If an Animal Withdrew from the Magazine #R10:--->s12 \ Animal stay in the magazine, loop (read the first line of s12 again). 0.1":--->s13 \ Animal withdrew from the magazine, go to next. s13, \ Waiting for Magazine Entry to Start Next Trial #R10:z3--->s3 \ When an animal nosepokes to the food magazine, send Signal of Magazine Entry(z3). #z2:--->s32 s32,\ End Process 0.01":--->sx S.S.4, \ End session process ------------------------------------------------- s1, \ Wait Start command #START:--->s2 s2, \ Wait End Signal, Calculation #z2:set b(2)=b(1)/b(3); set b(5)=b(4)/b(6);set b(14)=b(11)/b(10)--->s32 \ When Session End Singal(z2) comes, calculate the averages and go to End Process. \ b(1) = Sum of Reward Latency \ b(2) = Average of Reward Latency \ b(3) = The Number of Magazine Entry After Correct Response \ b(4) = Sum of Correct Response Latency \ b(5) = Average of Correct Response Latency \ b(6) = The Number of Correct Response \ b(10) = The Number of Incorrect Response \ b(11)= Sum of Incorrect Response Latency \ b(14)= Average of Incorrect Response Latency s32, \ End Process 1":--->stopabortflush \ Save the data to the hard drive and delete the memory. S.S.5, \ HouseLight Control (and FeederLight Control Related to Starting Signal)--------------------------------------------------- s1, \ Wait Start command #START:--->s2 s2, \ Controlling the house light #z8:ON^HouseLight;ON^FeederLight--->s3 \ When Signal to Flash Magazine Light(z8) or Singal of Finishing Time Out comes, turn on the lights, and go to next. #z7 ! #z9 ! #z12 ! #z13:ON^HouseLight--->sx \ Begin Time-Out #z2:OFF^HouseLight--->s32 s3, \ Flash Lights #z3:OFF^HouseLight;OFF^FeederLight--->s2 \ When Signal of Magazine Entry(z3) comes, turn off the lights. 0.1":OFF^HouseLight;OFF^FeederLight;add w(4)--->s4 s4, \ Flash Lights #z3:OFF^HouseLight;OFF^FeederLight--->s2 0.1":ON^HouseLight;ON^FeederLight;if w(4) >= 3 [@True,@False] \ Flashed 3 times? @T:set w(4)=0--->s5 \ If it is true, reset the counter and go to next. @F:--->s3 \ If it is NOT true, continue. s5, \ Wait Magazine Entry #z3:OFF^HouseLight;OFF^FeederLight--->s2 #z2:--->s32 s32, \ End Process 0.01":OFF^HouseLight--->sx S.S.6, \ Hole Light Control -------------------------------------------- s1, \ Wait Start command #START:--->s2 s2, \ Wait for the Start of 3-Choice Period #z11:ON a(j+6)--->s3 \ Begin 3-Choice period. #z2:--->s32 s3, \ Check Stimulus duration Q#T ! #z9 ! #z4:OFF 1,2,3,4,5,6,7,8,9--->s2 #z2:OFF 1,2,3,4,5,6,7,8,9--->s32 s32, \ End Process 0.01":--->sx S.S.7, \ Pellet(reward) Control ------------------------------------------------------- s1, \ Wait Start command #START:--->s2 s2, \ Wait Signal to Deliver a Food Pellet(z1) #z1:ON^Pellet--->s3 #z2:--->s32 s3, \ Turn Off the Feeder 0.1":OFF^Pellet--->s2 s32, \ End Process 0.01":OFF^Pellet--->sx S.S.8, \ Feeder Light Control (related to reward) ------------------------------------------------------- s1, \ Wait Start command #START:--->s2 s2, \ Wait Signal to Deliver a Food Pellet(z1) #z1:ON^FeederLight--->s3 #z2:--->s32 s3, \ Turn Off the Feeder #z3:OFF^FeederLight--->s2 #z2:--->s32 s32, \ End Process 0.01":OFF^FeederLight--->sx S.S.9, \ Show condition & DATA ----------------------------------------------------------- s1, \ Wait Start command 0.1": show 1,Trial,b(0),2,Corre,b(6),3,Incorr,b(10),4,Omiss,b(7),5,Pre,b(8),6,PreTO,b(9),7,R-TO,b(13),8,Persev,b(12); show 9,Elap-M, w(0),10,Elap-S,w(1),11,RewL,w(2),13,ResL,w(3); show 22,ExpTime,E,23,ITI,I;--->sx #START:--->s2 s2, \ show data 0.1": show 1,Trial,b(0),2,Corre,b(6),3,Incorr,b(10),4,Omiss,b(7),5,Pre,b(8),6,PreTO,b(9),7,R-TO,b(13),8,Persev,b(12); show 9,Elap-M, w(0),10,Elap-S,w(1),11,RewL,w(2),13,ResL,w(3); show 22,ExpTime,E,23,ITI,I;--->sx #z2:--->s32 s32, \ Show Final Data 0.5": show 1,Trial,b(0),2,Corre,b(6),3,Incorr,b(10),4,Omiss,b(7),5,Pre,b(8),6,PreTO,b(9),7,R-TO,b(13),8,Persev,b(12); show 9,Elap-M, w(0),10,Elap-S,w(1),12,AvRewL,b(2),14,AvCoL,b(5),16,AvInCoL,b(14); show 22,ExpTime,E,23,ITI,I;--->sx S.S.10, \ Correct or Incorrect Response Latency Timer -------------------------------------------------------------------- s1, \ Wait Start command #START:--->s2 s2, \ Wait for the illumination of stimulus light #z11:--->s3 \ start 3-Choice period s3, \ Correct or Incorrect Response Latency Timer 0.1": set w(3)=w(3)+0.1--->sx \ Timer #z4:set a(j+2)=w(3), b(4)=b(4)+w(3), w(3)=0--->s2 \ When Signal of Correct Response (z4) comes, record it, sum it, reset the timer and go to next trial. #z9:set a(j+10)=w(3), b(11)=b(11)+w(3), w(3)=0--->s2 \ When Signal of Incorrect Response (z9) comes, record it, sum it, reset the timer and go to next trial. #z7:set w(3)=0--->s2 \ When Signal of Omission (z7) comes, reset the timer and go to next trial. #z2:set w(3)=0--->s32 s32, \ End Process 0.01":--->sx S.S.11, \ Reward Latency Timer -------------------------------------------------------------------- s1, \ Wait Start command #START:--->s2 s2, \ Wait Correct Response Singal(z4) #z4:--->s3 \ When Signal of Correct Response (z4) comes, start the timer. #z2:--->s32 \ When Session End Singal(z2) comes, go to End Process. s3, \ Reward Latency Timer 0.1": set w(2)=w(2)+0.1--->sx \Timer #z3: set a(j+1)=w(2), b(1)=b(1)+w(2), w(2)=0; add b(3)--->s2 \ When Signal of Magazine Entry (z3) comes, record it, sum it, reset the timer, Magazine Entry +1, and go to next trial. #z12:set w(2)=0--->s2 \ When Signal of Perseverative Response(z12) comes, reset the timer and go to next trial. #z2:set w(2)=0--->s32 s32, \ End Process 0.01":--->sx