psych_trans2.gif (12714 bytes)
Home Up About MED-PC MED-PC At A Glance Command Glossary


MED-PC at a Glance

In order to run the experiments in an efficient and effective manner, it is necessary for you to understand how each experiment is structured, essentially the way in which the program was derived. You should therefore familiarize yourself with each program before you arrive at every experimental session. The easiest way to do this is to follow each step of the program, taking special note of the functions of each command. Refer to the corresponding notes for an explanation. Medstate notation (MSN) is a simple and logical programming language that can be learned quickly if approached in a straightforward manner. The following general program format and corresponding glossary have been provided to guide you when necessary.

General Program Format

Every MED-PC program is structured in a similar manner comprising two main components - the sequential input functions and the corresponding output functions. Both work together to create a complex sequential or parallel process. Outputs are determined by the preceding or current set of inputs. Some MED-PC programs have been designed to produce a cumulative record of response data through the use of the Soft Cumulative Recorder program. Because the first four experiments of the course are designed to create a cumulative record of events, it is important to note when the SoftCR is being used in each program (e.g. Array C). Furthermore, all programs are translated by TRANS20 and compiled by Turbo Pascal Compiler before becoming executable files.

The following is a generic program that has been formatted with full statement commands. The notes in the margins (denoted by a "\") explain each function in brief. Because you will be working with more elaborate programs than the following, expect to encounter commands other than the ones used here.

\Generic MED-PC Program \Title of program

\Define constants for stimuli and responses

\Note to tell program to define constants by a

\number. These numbers can be used

\interchangeably with each constant.

^RightLever=1

^Leftlever=2

^OmniLever=3

^Hand switch=4

^HouseLight=1

^RightLight=2

^Feeder=3

^LeftLight=4

^RightNoise=5

^LeftNoise=6

\Z1 explained. First Z-pulse defined for program

\Z2 explained. Second Z-pulse defined for program

\Dimension array C where the data used to generate a cumulative record will be used.

DIM C = # \The DIM command sets the

\dimensions (size) of the array.

s.s.1 \Begins the first state set.

s1, \Begins the first statement of state set one.

#Start:--->s2 \Start command, always issued by keyboard.

\---> tells computer to go to next step.

s2,

#R^Handswitch:On^HouseLight--->s3 \#R command serves as R-response

\On command turns on stimuli that follows

s3,

#R^Handswitch:On^Feeder;Z1; ADD A--->s4 \ADD command adds 1 to variable A

\each time the feeder is operated.

\Z1 is used here as an output that is

\ detected in S3 as of S. S. 4.

 

s4,

.05":Off^Feeder;IF A>=10 [@true,@false] \.05" refers to seconds in which feeder operates

@true: off ^ Houselight;SET A=0--->s3 \Off command turns off stimuli that follows ^

@false:--->s2 \IF command sets either/or statement

\[@true,@false] command sets up parameters \for either/or statement.

\SET command resets variable A to zero

\If statement is false, program repeats starting \with statement s2.

 

\The next part of the program will set up the cumulative recorder for data output. [NOTE: This \example is very basic as you will find that most of the other cumulative record programs are \more elaborate. Refer to the MED-PC manual when necessary.]

s.s.2,

s1,

#start:-->s2

s2,

#Z2-->s2 \Z2 issued in S. S. 3 forces the timer to restart every time a response occurs

0.1"Add T--->SX \and sets the value of the counter to 0

s.s.3,

s1,

#start:--->s2

s2,

#R^RightLever:SET C(I) = T+0.1,T=0;Z2; \A lever press records the time into the C array

ADD I;IF I = 1000 [@true,@false] \Z2 resets the counter that keeps time in S. S. 2.

 

@true:-->stopabortflush \Stopabortflush command ends program and \records data to a file in the hard disk.

@false:-->set C(I) = -987.987-->SX

\-987.987 command constant to stop cumulative

\record at final response without recording

\subsequent blank response slots.

\The following state sets the reinforcement pip code in Array C.

 

s.s.4,

s1,

#start:-->s2

s2,

#Z1:SET C(I) = 0.2;ADD I;IF I = 1000 [@true,@false]

@true:-->stopabortflush

@false:-->set C(I) = -987.987-->SX

 

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

s.s.5,

s1,

#start:-->S2

\Tell your TF to issue a #k99 keyboard command

s2,

#k99:-->STOPABORTFLUSH \#k99 command stops the program immediately

\and records the data collected up to this point.