How to set things up the first time

  1. Identify your computing team. In each setup, there is a MAIN/MASTER computer that coordinates all activity in the experiment and a STIMULUS computer that shows visual stimuli. In addition, there may be one or more additional specialized computers that perform other functions (like a 2-PHOTON computer, or an INTRINSIC IMAGING computer, etc).

  2. Our devices communicate with each other over the internet by writing files. We have found this to be the most reliable way of sending messages among computers (we have tried sockets and other things before). Typically, we set up a shared directory on the MASTER computer. If it is a Windows computer, Linux computer, or Mac computer, you can set up a Samba shared drive. We typically share the directory C:\remote\ on the MASTER computer.

  3. It is necessary to mount the remote directory on the STIMULUS computer. These days, our stimulus computers are almost exclusively Linux-based (Ubuntu). There is a handy guide that we partially reproduce here.

    1. To mount the directory on Ubuntu, from the Unix command line, run sudo apt-get install cifs-utils to install the utility.

    2. Next, make the directory with sudo mkdir /media/remote

    3. In your Linux home directory, make a file called .smbcredientials. You might use gedit by writing gedit ~/.smbcredentials. Add two lines to this file: username=myusername and password=mypassword, where myusername and mypassword are your username and password on the MASTER machine.

    4. Next, edit the /etc/fstab file (with root privileges, maybe with sudo gedit /etc/fstab) and add a line //servername/sharename /media/remote cifs credentials=/home/ubuntuusername/.smbcredentials,iocharset=utf8,sec=ntlm 0 0

    5. Type sudo mount -a (this means mount all file systems automatically). You should then see your remote directory by typing ls /media/remote. It should automatically appear there now when you reboot your Linux computer (assuming your MASTER computer is already running; turn on your MASTER computer first as a general rule).

    6. If you ever find yourself in a situation where the file system is not there (that is, ls /media/remote yields empty), you can force it to remount with sudo mount -a on the command line.

  4. Install MATLAB.

  5. From MATLAB, Install the Psychophysics Toolbox on the STIMULUS computer, probably by following these instructions.

  6. Test that the Psychophysics Toolbox works by running GratingDemo from the Matlab command line. It should run without errors (but possibly some warnings).

  7. Now we need to set up the STIMULUS monitors. Run the handy included program XOrgConfCreator (described here). Set your visual stimulus monitor as monitor 0 and your computer monitor (to see what is going on on the computer) to 1.

  8. Install VH lab tool stack for Matlab by following the instructions at http://code.vhlab.org. Install the stack on both the MASTER and the STIMULUS computer.

  9. Now we will tell the MASTER computer how to talk to the STIMULUS computer.

    1. On the MASTER computer, open the ~Documents/MATLAB/tools/vhlab_configuration folder and edit the file NewStimConfiguration.m . Set the following values (if they aren't set already).
      Remote_comm_isremote = 0;
      Remote_comm_enable = 1;
      Remote_comm_dir = 'C:\remote\'; % or whatever you chose
      Remote_Comm_localprefix = 'C:\remote\';
      Remote_Comm_remoteprefix = '/media/remote/';
      StimComputer = 0;

  10. Now we will tell the STIMULUS computer how to talk to the MASTER computer:

    1. On the STIMULUS computer, open the ~Documents/MATLAB/tools/vhlab_configuration folder and edit the file NewStimConfiguration.m . Set the following values (if they aren't set already).
      Remote_comm_isremote =
      1;
      Remote_comm_enable = 1;
      Remote_comm_dir = '
      /media/remote'; % or whatever you chose
      Remote_Comm_
      remoteprefix = 'C:\remote\';
      Remote_Comm_
      localprefix = '/media/remote/';
      StimComputer =
      1;
      StimTriggerAdd('VHTrig',[]); % make this is
      NOT commented if you are using the VHlab stim trigger technique with interconnect board

  11. Now we can test the setup.

    1. On the STIMULUS computer, run initstims on the Matlab command line. You should see the stimulus monitor light up, show a grating, and then you should see the command line waiting and saying "Waiting for remote commands..."

    2. On the MASTER computer, run RunExperiment on the Matlab command line. Go to the window that will open called ScreenTool. Click the button GetRectRemote. You should see the system say "Please Wait" and then it should go away.

    3. [add more tests here]