ANY-maze Help > The ANY-maze reference > The Protocol page > The elements of a protocol > Inputs and outputs > Laser controllers > Setting up a laser controller > Setting the laser controller activation and reset options

Setting the laser controller activation and reset options

In brief

You should use the buttons on the laser controller's settings page to specify when the laser should be activated.

As well as these options, you can also control the laser using a procedure, something which is described in more detail below.

Specifying when the laser should be activated

Clearly, if you've included a laser controller in your protocol, it's because you want to turn it on and off during the tests - but when should it turn on? In some cases, the answer may simply be 'when the test starts'; but in other cases you may want to do more sophisticated things, perhaps turning it on and off as the animal moves into different zones.

Activating the laser at the start of the test

For the simple case of activating the laser at the start of the test, you can use the option here (in the protocol's laser controller settings). This doesn't mean you can't also use a procedure (perhaps to switch it off again); it just means that when the start starts, the laser will be activated.

Activating the laser based on more complex rules

In this case, you should use a procedure to activate (and/or deactivate) the laser. Full details are beyond the scope of this help topic, as it rather depends on what you want to do; but, for example, the procedure in figure 1 will wait until the animal enters the 'Target zone' and will then activate the 'Optogenetic laser'. More details can be found in the Introduction to procedures.

  

  

Figure 1. This simple procedure will activate the 'Optogenetic laser' when the animal enters the 'Target' zone.

Activating the laser BEFORE the test starts

If you want to activate a laser before the test starts, then the best method is to create a procedure to do this; as can be seen in figure 2, this is very simple.

  

  

Figure 2. This one-statement procedure will activate the 'Optogenetic laser' before the test starts (because statements in the orange-shaded area are performed as soon as the test is ready).

The key point here is that statements in the orange-shaded area at the top of the procedure editor are performed as soon as the test is ready. So, if you add an Action statement (to activate a laser controller) to this area, then the laser will be activated before the test begins.

Resetting a laser controller at the end of a test

When a test ends, ANY-maze will deactivate the laser and reset it to the values entered on the laser's settings page. However, there are circumstances when you might not want this to occur, for example:

 1.You might not want the laser controller to switch off until after you have removed the animal from the apparatus.  
 2.You might be planning to run tests back-to-back, and whatever the laser's state was at the end of one test, you want to continue in the next one. So if it's on at the end of one test, then if it's not reset, it'll still be on at the start of the next one.  
 3.You might have used a procedure to alter some parameters of the laser; for example, the procedure may have changed the pulse frequency during the test. If the laser controller is reset at the end of the test, then the frequency will be reset to whatever the default frequency is (as defined in the laser controller's settings in the protocol), but what if you want to retain the frequency set by the procedure (so it's used in the next test)?  

The option Don't reset at the end of the test would appear to be the solution to these requirements, but in fact in most case it will only actually be suitable for situation #1. For #2 and #3 selecting it probably won't have quite the effect you'd expect:

 The state would be retained from one test to the next, but not from one trial to the next. For example, imagine that your test schedule is such that you will test animal 1 in its first trial, then animal 2 in its first trial and then animal 1 in its second trial, etc. What would happen is that after animal 1's first trial the state of the laser (e.g. its pulse frequency) would remain the same and so this would be the state that would apply to animal 2's first trial... which is probably not what you want. 
 Even if the above didn't apply (for example, in your schedule you might test animal 1 four times in a row), then if you exited ANY-maze after trial 2 and then restarted it again, the state of the laser would be lost.  

The best way to ensure that a laser's state is retained from one trial to the next (even if you close the experiment, exit ANY-maze and turn off your computer between tests) is to use a procedure; this is described in detail here.

See also:

 An introduction to procedures 

© Copyright 2003-2026 Stoelting Co. All rights reserved

ANY-maze help topic T0248