Blanking the laser between trials

Sometimes, during long behavioral sessions, it is advantageous to turn off the laser between trials to minimize damage while keeping the microscope scanning.  To do this without introducing any additional noise that may influence the behavioral state we use the Pockels cell.  Scanbox now allows one to blank the laser by sending a command over the network.  The following piece of code will, for example, turn the laser on and off every 2 sec.

open_sbserver % open connection to Scanbox server
while true
send_sbserver('L0'); pause(1); %blank laser
send_sbserver('L1'); pause(1); % turn it back on
end

And the laser power will be modulated without any interruption in the operation of the microscope: