User Tools

Site Tools


CIGAL Reference Manual, Chapter 1 (Topics): background

Running CIGAL in the background while running other software

If you already have your behavioral tasks set up using other software (e.g. EPrime, Presentation, Matlab, etc.) you can run that software for task stimulus and button response recording, and run CIGAL simultaneously to record synchronized physiological and eye-tracking signals. This works well provided that your computer has 2 video monitors so that each program can be run on a different screen. In that case you can run CIGAL on the secondary monitor while you run your regular behavioral software on the primary monitor. Both programs can be automatically triggered by the scanner so that they run in synchrony. You (and your subject) will see your task stimuli displayed on the main screen, and you can watch the physiological and eye-position signals displayed simultaneously in real-time on the second screen. CIGAL uses almost no computer time for its data recording and very little for its display; running on a modern dual-core computer CIGAL has no significant impact on the timing accuracy of the other program.

Understanding how to run two programs simultaneously without interference

In order to run two programs simultaneously you must configure each so that they do not attempt to compete for the same limited resources when they run. As long as they don't compete for resources you can run each program independently, without either having to know anything about what the other is doing.

The main resources that need to be shared between running programs are:

  • computer processor
  • computer memory
  • disk access
  • standard input devices (keyboard and mouse)
  • standard output devices (video and sound)
  • extra input devices (e.g., button box, scanner trigger pulse, analog waveform input, eye-position input, network socket connections)
  • extra output devices (e.g., analog/digital output, video switch connection)

On a dual-core or quad-core computer, the computer processor itself is not a limited resource because two independent programs running together will automatically be run on separate computer processors. Computer memory is limited but BIAC scanner computers have quite a lot of memory so there shouldn't be a problem as long as the background process (i.e., CIGAL) doesn't use very much (e.g., no more than 10% of RAM). Disk access can easily be shared simply by making sure the background process only does disk I/O between scan runs.

Standard output resources such as the video display and sound output can be shared easily by allocating separate parts of the display to each program, and by restricting sound output to just one program source at any given time. In practice, the easiest way to do this is to have each program displayed on a separate video monitor and only one of the programs allowed to play sounds.

Standard input devices, such as the keyboard and mouse, can only be used by one program at a time, but we are already used to switching input focus between programs simply by clicking on different windows on the screen or tabs on the taskbar. On a Windows computer you can also change the input focus by pressing <Alt><Tab> together (which is useful if you can't see all the windows or the the taskbar). In general, the keyboard and mouse remain connected to whichever program you used them for most recently.

Other externally connected devices are the more problematic limited resources that can usually can only be accessed by one program at a time. This includes some button boxes, video switch connections, analog devices (i.e., physiology signals), scanner trigger devices, eye-tracking signals, or any other hardware connected device that is explicitly opened by any program. Once one program has opened a device or communication channel, no other program can open it until the first program stops running or explicitly closes the device. If you plan to run 2 programs simultaneously, therefore, you must make sure that they do not both attempt to open the same external hardware resources. Fortunately that generally just involves a one-time configuration check (see below) for each program to make sure they are compatible.

Sharing hardware resources on the BIAC scanner computers

The Windows computers at the BIAC scanners are already set up in such a way that it is easy to run 2 behavioral programs simultaneously. The main stimulus control computer has 2 video monitors that you can configure as one wide desktop and then run one program on each screen. The sound and button boxes only need to be used by the main task program (e.g. EPrime, Presentation, etc); they are not needed at all by the physio recording program (i.e., CIGAL). The important inputs to CIGAL in this arrangement are the analog input device (the Measurement Computing USB device), and the eye-tracking signal if it is being sent over from the second Windows computer at the scanner. The task control software therefore, must not attempt to open the Measurement Computing device. CIGAL also provides a simple pull-down menu interface to control the Video Switch box; if you plan to use that feature make sure that you do not try to run the other VideoSwitch control program at the same time.

The scanner trigger pulse is the most important external input signal you need to think about when running two programs, because that is the best way to make sure they are accurately synchronized with each other (and with the scanner). BIAC provides the scanner trigger signal on multiple different input devices, which means that two programs can read the same trigger signal, provided they read it on different hardware channels. CIGAL should be configured, therefore, to read the scanner trigger from the analog input device, which it has open anyway in order to record the physiological waveforms. That allows the other program to access the scanner trigger pulse from the serial response box (EPrime SRbox), or from a parallel port input (probably no longer available on Windows 7 computers), or by simply manually starting the program by pressing a keyboard key. Since CIGAL will trigger from the scanner automatically, you are free to start your other program however you like, provided it does not use the Measurement Computing USB analog/digital device.

See Also:
Configuring CIGAL for background recording
Configuring EPrime for compatibility with CIGAL in background
Configuring Presentation for compatibility with CIGAL in background
Configuring Matlab for compatibility with CIGAL in background
Starting CIGAL and your other behavioral software\\Running CIGAL for background recording


CIGAL Manual,
Topics List,
Manual Help

jvs/cigal/manual/chapter1/background.txt · Last modified: 2014/08/04 16:03 (external edit)