# This Zanscript demonstrates how a light dark script may work on the MWP unit. INCLUDE ZSYS # This includes background commands from the system software. Always include this. DEFINE ACCLIMATION 5 # Defines this term (which is used below in the script) with a value (in this script it # will be a time in seconds; Change the number to any amount of time you need, in secs; # Change the name to a term you want). DEFINE BIN 10 # Defines this term (which is used below in the script) with a value (in this script it # will be a time in seconds; Change the number to any amount of time you need, in secs; # Change the name to a term you want). SET(tile_size,5) SET(AUTOREF_MODE,1) # These 6 SET commands are necessary for tracking. These with always be included. SET(AUTOREF_TIMEOUT,10) # Change the amount of time needed to wait for the autoreference image by changing # the AUTOREF_TIMEOUT number to a lower number. SET(DETECTOR_THRESHOLD,6) SET(SEARCH_DISTANCE,10) SET(SEARCH_STEP,3) SET(FILTER_RADIUS,3) SET(MAXIMUM_TARGETS,1) SET(COUNTER1,COUNTER_ZERO) # Sets the data output counter label to begin at 0. The counter is used in the script # below to label the data in numerical order. LOAD(ARENAS,"arenas_24.bmp") # This command loads the bitmap which indicates where the arenas are located. Ensure # the asset is loaded into the Assest Directory folder on the homepage. ACTION MAIN # This is the whole experiment's outline/schedule. The actions listed here are always # further explained below. LOGCREATE("TEXT:TIME|TEXT:|TEXT:|TEXT:|TEXT:VARIABLE|TEXT:CONDITION|TEXT:TIME_BIN") LOGAPPEND("TEXT:A1|TEXT:A2|TEXT:A3|TEXT:A4|TEXT:A5|TEXT:A6") LOGAPPEND("TEXT:B1|TEXT:B2|TEXT:B3|TEXT:B4|TEXT:B5|TEXT:B6") LOGAPPEND("TEXT:C1|TEXT:C2|TEXT:C3|TEXT:C4|TEXT:C5|TEXT:C6") LOGAPPEND("TEXT:D1|TEXT:D2|TEXT:D3|TEXT:D4|TEXT:D5|TEXT:D6") LOGRUN() INVOKE(BRIGHT,1) WAIT(ACCLIMATION) # System waits this amount of time before beginning the next command. (Which is defined above) AUTOREFERENCE(1) # This creates an autoreferenced image of the plate prior to invoking the trials. Needed # for tracking. #VIDEO(180,"LocomotorMonitoring") # Record X seconds of video into file with given prefix. Change the name of your file by #editing the name inside of the "". LIGHTS(ALL,OFF) # This ensures all the lights are off when the trial begin. INVOKE(MMDARK,1) # Starts the ACTION named here and repeats the command for the above predefined amount of # times (term after the comma). You can change the number of times these commands are invoked # by changing the number in the DEFINE command above. INVOKE(MMBRIGHT,1) # Starts the ACTION named here and repeats the command for the above predefined amount of times # (term after the comma). You can change the number of times these commands are invoked by # changing the number in the DEFINE command above. INVOKE(MMDARK,1) # Starts the ACTION named here and repeats the command for the above predefined amount of times # (term after the comma). You can change the number of times these commands are invoked by # changing the number in the DEFINE command above. INVOKE(MMBRIGHT,1) # Starts the ACTION named here and repeats the command for the above predefined amount of times # (term after the comma). You can change the number of times these commands are invoked by # changing the number in the DEFINE command above. INVOKE(MMDARK,1) # Starts the ACTION named here and repeats the command for the above predefined amount of times # (term after the comma). You can change the number of times these commands are invoked by #changing the number in the DEFINE command above. COMPLETE # Signals the system that the ACTION MAIN is complete. ACTION MMDARK # Defines this ACTION below which is used in ACTION MAIN. INVOKE(DARK,1) SET(COUNTER1,COUNTER_INC) # Labels the data output in numerical order. In this script, the time bins are labeled 1-6. LOGDATA(DATA_SNAPSHOT,"begin") # DATA_SNAPSHOT records info at the specific time indicated. Here the data at the beginning # of the trial is recorded for later comparison with the next SNAPSHOT. You can change the # name by editing inside the "". WAIT(BIN) # System waits this amount of time before beginning the next command. (Which is defined above). LOGDATA(DATA_SNAPSHOT,"end") # Recording info at the end of trial. Here the data recorded is compared to the previous # SNAPSHOT to give your data during the this previous time slot. LOGDATA(DATA_SELECT,"begin") # Data select command pulls the data from the named SNAPSHOT begin above. LOGDATA(DATA_DELTA,"end") # Data delta command does the calculation between the first SNAPSHOT in the series to the # next one. In this SNAPSHOT "begin" is substracted from the SNAPSHOT "end" to give data variables. LOGCREATE("RUNTIME|TEXT:|TEXT:|TEXT:|TEXT:ARENA_DISTANCES|TEXT:DARK") LOGAPPEND("COUNTER1|ARENA_DISTANCES:*") LOGRUN() # Tells the unit to output the data from the previous LOGCREATE (and LOGAPPEND) command. COMPLETE # Signals the system that this ACTION is complete. ACTION MMBRIGHT # Defines this ACTION below which is used in ACTION MAIN. INVOKE(BRIGHT,1) SET(COUNTER1,COUNTER_INC) # Labels the data output in numerical order. In this script, the time bins are labeled 1-6. LOGDATA(DATA_SNAPSHOT,"begin") # DATA_SNAPSHOT records info at the specific time indicated. Here the data at the beginning # of the trial is recorded for later comparison with the next SNAPSHOT. You can change the # name by editing inside the "". LOGCREATE("RUNTIME|TEXT:|TEXT:|TEXT:|TEXT:ARENA_DISTANCES|TEXT:BRIGHT") LOGAPPEND("COUNTER1|ARENA_DISTANCES:*") WAIT(BIN) # System waits this amount of time before beginning the next command. (Which is defined above). LOGDATA(DATA_SNAPSHOT,"end") # Recording info at the end of trial. Here the data recorded is compared to the previous # SNAPSHOT to give your data during the this previous time slot. LOGDATA(DATA_SELECT,"begin") # Data select command pulls the data from the named SNAPSHOT begin above. LOGDATA(DATA_DELTA,"end") # Data delta command does the calculation between the first SNAPSHOT in the series to the # next one. In this SNAPSHOT "begin" is substracted from the SNAPSHOT "end" to give data variables. LOGRUN() COMPLETE # Signals the system that this ACTION is complete. ACTION DARK SET(GPO6,0) # These 3 commands turn off the overhead lights- red (GP06), green (GP07) and blue (GP08) SET(GPO7,0) SET(GPO8,0) COMPLETE ACTION BRIGHT SET(GPO6,1) # These 3 commands turn on the overhead lights- red (GP06), green (GP07) and blue (GP08) SET(GPO7,1) SET(GPO8,1) COMPLETE