psych_trans2.gif (12714 bytes)
Home Up Equipment Test Pgm. Exp. 1 Pgm. Exp. 2 Pgm. Exp. 3 Pgm. Exp. 4 Pgm. Exp. 5 Pgm. Exp. 6


Cup Approach Program

\VER 2.1: Modified 7/26/99

\Cup approach training.

\This program will deliver a pellet (100 times) when the hand switch is pressed,

\and also records the time elapsed between when the pellet was delivered and

\hand switch is pressed again.

\The following statement defines the constants for stimuli and responses.

^RightLever=1

^LeftLever=2

^OmniLever=3

^Handswitch=4

^Houselight=1

^RightLight=2

^Feeder=3

^LeftLight=4

^RightNOise=5

^LeftNoise=6

^ExternalLight=7

\Dimension the array C that will be used to record the

\100 latencies:C(0)...C(99)

\Dimension of array D that will be used to record

\duration of the inter-trial intervals:

\D(0)...D(99)

DIM C=101

DIM D=101

\****************************************************************************

\Initially the program will allow you to turn

\on the light by pressing your Hand switch

\and deliver an the first pellet by pressing a second time.

S.S.1,

S1,

#Start:--->s2 \The start command will be issued from the keyboard.

s2,

#R^Handswitch:On ^Houselight--->s3 \Pressing the hand switch once

\turns on the house light

S3,

#R^Handswitch:On ^Feeder--->s4 \Pressing again delivers

S4,

.05":off ^Feeder--->s5 \one pellet

\the next statement delivers a pellet and starts a

\timer that stops when the hand switch

\is pressed again.

s5,

#R^Handswitch:On ^Feeder;Add A;Z1--->s6 \Variable A increases

s6, \by one every time a pellet

.05":Off ^Feeder ---> S7 \is delivered.

\Z1 is a signal to start the

\timer in S.S.2.

s7,

#R^Handswitch:Z1;z6;IF A=101[@true,@false] \Statement to stop the timer,

\check number of pellets

\delivered, and flash lights

@true:--->stopabortflush \After 100 pellets stop and record the

@false:--->s5 \data and, goes back to s5 for the next

\pellet delivery.

\****************************************************************************

\The following statements keep track of the latencies & ITI of each the 100

\trials and stores the data in arrays C and D

S.S.2,

s1,

#Start:--->s2

s2,

.1":set T = T + .1 --->SX \T keeps time in .1" sec increments

#Z1:Set D(I)=T,T=0 --->s3 \Gets a Z1 pulse to start timer

s3,

.1":set T = T + .1 --->SX \T keeps time in .1" sec increments

#z1:Set C(I)=T,T=0;ADD I;If I>101 [@TRUE,@FALSE] \Records the latency

\and checks number of

\pellets delivered,

@TRUE:--->STOPABORTFLUSH \If 100 pellets;

\Stops the program and records

\the data on the hard disk.

@FALSE:Show 1,TRIALN, A, 2, LATNCY,C(I-1);

SET C(I)=-987.987--->S2 \If less than 100 goes back and

\wait for the next trial.

\The last counter in the

\array gets set to -987.987.

\This is done in case you have to

\stop early e. g. 50 trials unused

\trial 51-100 don't get written in

\the hard disk.

\**************************************************************************

\This state is used in case you need to stop the experiment early.

S.S.3,

S1,

#START:--->S2 \Tell you TF to issue a #k99 keyboard command

S2,

#k99:--->STOPABORTFLUSH

\**************************************************************************

s.s.4, \Flashes light when z6 is received

s1,

#z6:on ^ExternalLight--->s2

s2,

.2":off ^ExternalLight--->s1