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


Glossary of Commands

Following is an alphabetical listing of most of the MED-PC commands you will encounter throughout this course. Each definition provides an explanation of the function of the command, how the command appears in text, and an example of the syntax of the command. Where definitions are not provided, you can consult any of the manuals or ask your Teaching Fellow.

-987.987 - -987.987 - Setting the last data element in an array to -987.987 prevents saving and/or printing all 0 value elements to the file when a data file for a program is small. Denoted by -987.987 and used after a transition or IF statement (e.g., @false:-->set C(I) = -987.987-->SX).

#K99 - #K99 - The #K99 command is used to kill and stop execution of a program immediately. Denoted by #K99 and always placed as a response command prior to the final transition statement of a program (e.g., #k99:-->STOPABORTFLUSH).

Add - ADD - The add command is used to increment a variable or array element by 1. Denoted by ADD and followed by the variable (e.g., R) or array element (e.g., C).

Arrays - Arrays are automatically created by MED-PC as 26 variables (A through Z), and the values of array elements are always equal to 0 until explicitly changed. Denoted by a variable (A through Z), as stated by the programmer. Special arrays exist, such as C (used to set the values for the cumulative recorder), but any variable can be used. Every array is defined before execution of the first state set. See also DIM command.

Constants - Constants are used to substitute words for integers, which are frequently used throughout a program. Here the constants refers to hardware of the box as denoted by the function of each constant and corresponding integer (e.g., Hand switch, RightLever), always defined before the execution of the first state set.

DIM - DIM - The DIM command sets the size of an array before the first state set is executed. (The values of array elements are always equal to 0 until explicitly changed, and the DIM statement declares each array. Denoted by DIM and followed by a numerical value for the stated array. For example, DIM D=120 sets aside 121 elements with subscripts 0 through 120. See also arrays and SET command.

Explicit Time Inputs - " or ' - Time inputs are used to generate increments of time for reinforcers or z-pulse timers. Only one time expression may occur within a single state; time values are reset upon entry into each state. Denoted by a double quote (") for seconds and a single quote (') for minutes, always located before an activation command (e.g., Off^Feeder).

If - IF - The IF command is used to compare a numeric parameter to a variable or one variable to another. Six comparison operators are associated with the if command, as follows: equals (=), less than (<), less than or equal to (<+), greater than (>), greater than or equal to (>=), or not equal to (<>). Denoted by IF and followed by a comparative statement (e.g., IF A>=100). See also True/False statement.

On/Off - ON or OFF - The on and off commands are use to turn outputs on or off, respectively. An output that has been turned on must be turned off before using it again unless you are terminating the program. Denoted by ON or OFF, depending on the desired state of the output, usually placed before the output statement (e.g., ON^Feeder). NOTE: The feeder must always be turned off (e.g., .05":off ^Feeder;-->SX).

OR - ! - The OR command allows several conditions to cause a transfer to the same output. For example, OR is used to produce activation from either the left lever or right lever to produce a reinforcement. Denoted by "!" and is always placed between two activated stimuli (e.g., #R^RightLever ! #R^LeftLever:).

Response - #R - A response command results from the electrical grounding of an input from the MED ASSOCIATES interface and allows for sequential processing to occur. A response is activated when the command issues an output from another source (e.g., Hand switch). Denoted by #R, always located before a "^" command.

Set - SET - The set command is used to set an array and/or variable to perform simple mathematical operations where two or more operands are used. The four operators allowed are division (/), multiplication (*), addition (+), and subtraction (-). Denoted by SET and followed by a specified array and/or variable and the mathematical operation (e.g., SET C (I) = T + 0.1, T=0).

Show - SHOW - The show command allows data to be displayed to the screen while a procedure is running. Three displays are allowed for each Show command, as follows: a screen position, a 6-character label, or a number, variable, or constant. Denoted by SHOW and followed by a position number, a label, and a value (e.g., SHOW 1,TRIALN, A).

Start - #Start - The start command holds a state set in a suspended state until the Teaching Fellow issues the command from the keyboard. Denoted by #Start, usually located at the beginning of each program, but can appear more than once and in any state set.

State Sets - S.S.n - A state set is a set of statements which defines each part of the program. Only one state set may be present at any point in time. State sets allow sequential actions to occur in parallel. Denoted by S.S.n, where n stands for any number (default 1) and is located at the beginning of each set.

States - Sn - A state describes what action will be produced by a stated input. Denoted by Sn where n stands for any number (default 1) and is located after the state set is defined and before each statement is made.

Stopabortflush - STOPABORTFLUSH - Using the stopabortflush command will immediately stop the execution of a program and will automatically write all data to the disk under a specific file name. All outputs which are currently on will get shut off immediately. Denoted by STOPABORTFLUSH, usually placed as a transition state after an IF command or at the end of the program. See also stopkill command.

Stopkill - STOPKILL - The stopkill command will immediately stop the execution of a program without saving the data. The data from procedures terminated by STOPKILL are not placed in the dump queue and are not recoverable. Denoted by STOPKILL, usually placed at the end of a experimental program (e.g., equipment test). See also stopabortflush command.

SX - SX - A SX command is a transition statement that will not execute a line and allows multiple transitions to occur over more than one state set. Also allows two statements to be stacked such that only one statement will ever be executed. Denoted by SX and placed as a transition (e.g., .1":ADD A --> SX).

True/False - [@true,@false] - A true/false statement makes a logical comparison from an IF statement and sets the parameters for action depending on if the statement is correct or not correct. Denoted by [@true,@false] (see note), preceded by an IF statement and followed by a justification for both conditions. NOTE: The labels of "true" and "false" are arbitrary. Other labels can be used (e.g., [@stop,@continue].

Z-Pulses - #Zn - A z-pulse is used to communicate and coordinate between state sets and is always generated from the output section of the program. Z-pulses are usually used to indicate the activation of a timer and are always commented at the beginning of the program. Denoted by #Zn, where n stands for any number (default 1) and is located throughout either the input or output sections of the program when a timer is necessary.