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 > Playing an arbitrary sequence of pulses using an external file

Playing an arbitrary sequence of pulses using an external file

In brief

ANY-maze's laser controller settings are quite comprehensive, but it might be that rather than using a pulse train or a continuous signal, you want to use an arbitrary sequence of pulses. For example, you may have recorded an animal's neural activity from a previous test, and you may wish to pulse the laser on or off at the exact times that the animal's neural activity happened in this previous test. ANY-maze allows you to do this by specifying the sequence of pulses in a 'pulse train file'.

 How it works 
 Creating a pulse train file 
 Using the pulse train file in a test  

How it works

ANY-maze allows you to specify, for each laser controller, a 'pulse train file' containing a sequence of pulses for that laser. You can use a different file for each laser, or the same one for all of them - it's up to you. The pulse train file can contain an entirely arbitrary sequence of pulses, down to millisecond resolution, and can even adjust the intensity (voltage) of the laser controller (if your lasers support this feature).

All pulse train files that you specify are loaded into the ANY-maze Optogenetics interface just before the start of a test. The pulse sequence contained in the file can be played from the moment the test starts (using the laser controller's settings page, or alternatively you can turn it on at any point during the test using a procedure. The important thing to remember is that once the file has been downloaded to the hardware, it will stay there for the duration of the test - if you're using a procedure, you can switch between this pulse train file, a continuous signal and a basic pulse train as many times as you like during the test. So, for example, you could play this pulse train file when the animal enters a specific zone, and switch to a standard pulse train on entry to other zones. Alternatively, you could play the pulse train file whenever the animal is feeding, and turn it off at other times.

Creating a pulse train file

Creating a pulse train file is easy - it's just a simple text file. Full details of the contents of a pulse train file are contained in the Pulse train file formats topic, but briefly, the file can contain:

 DurationsSpecifies the duration that the laser is off, followed by the duration that it is on (together with an optional voltage/intensity).
 Pulse times and widthsSpecifies the time that a pulse should be turned on, together with the duration to turn it on for (together with an optional voltage/intensity).
 Pulse on/off timesSpecifies the time that a pulse should be turned on, followed by the time that the pulse should be turned off. Again, the voltage/intensity can be optionally specified.

Using the pulse train file in a test

Once you've created a pulse train file, you need to use the laser controller's settings page to link the pulse file with a given laser controller. To do this, simply use the to open the Choose pulse train file window. This will allow you to navigate to the file that you've created.

On the laser controller's settings page, you'll also specify whether you'll play the pulse sequence just once (and then turn the laser off), or whether you'll repeat the contents of the file. If you choose to play it repeatedly, then the pulse sequence will play from start to finish, then repeat again from the start, and so on until either the laser is turned off, or the source of the laser controller changes (to a pulse train or a continuous signal), or the test finishes.

Specifying a pulse train file will simply ensure that the file is loaded into the ANY-maze Optogenetics interface at the start of the test, making it available for use during the test. To actually use the file, you can do one of the following:

 Specify Turn on when the test starts on the laser controller's set-up page to start the pulse sequence playing as soon as the test starts. 
 Use a procedure to specify that the laser controller's source should be a pulse train file - using one of the Set laser controller output to pulse train file... actions. Once you've set the source, use the Activate laser controller action to actually start it playing.  

See also:

 Specifying the effect of activating a laser controller 
 Pulse train file formats  

© Copyright 2003-2026 Stoelting Co. All rights reserved

ANY-maze help topic T0244