Certain environment variables have a special meaning to calibrate, and to the capture programs. These environment variables specify various parameters related to the type of A/D converter used. The variables DACPCLK0 and DACPCLK1 indicate the device names for the first and second clocks, such as "/dev/dacp0/efclk0" and "/dev/dacp0/efclk1" for the EF12M. (The defaults for these are "/dev/dacp0/clk2" and "/dev/dacp0/clk3".) Calibrate only uses DACPCLK1. On Linux-based PowerDAQ systems, the A/D doesn't have separate device nodes for the clocks, so these variables are simply set to the same device name as the DACPAD variable. The variable DACPAD indicates the device name for the A/D converter. (The default for this is "/dev/dacp0/adf0".) For systems configured to use a networked capture server, such as any NI USB or PCI based systems, as well as any 64-bit Linux system, the DACPAD variable will instead indicate the URL used to contact the server. ADGAINTYPE should be set to "2" on your machine if gains increase by powers of 2 rather than powers of 4. ADGAINTYPE should be set to the power by which gains on your A/D converter increase, e.g. 10 for an A/D that supports gains of 1, 10, 100 and 1000, and it should be set to "1" for converters that don't have programmable gain. ADRANDOM must be set to "no" if your hardware cannot support random channel addressing. ADMAXLEV must be set to the maximum input voltage of your A/D converter (in microvolts), if it is anything other than the default of "5000000". ADGAINCODE can be set to the desired default gain code (0 to 3), if the standard ±5V input range is inappropriate. Note that this sets the gain code, not the resulting gain factor, which is dependent on the type of A/D converter on your machine. MAXADCHANS should be set to the number of channels supported by your A/D hardware, if it is anything other than the default of "16". All of these environment variables should be set in your ".login" file, so you won't have to bother setting them each time.
When invoked, calibrate prints the following menu prompt line:
An operation is initiated by typing a single letter, the first letter of an item in the menu line. You can also step through the menu using the space bar and the backspace (or erase) key, to highlight the item you want, then press RETURN to select that item.
Next, you are asked whether you want to measure the calibration peak from a pulse, as opposed to measuring just the peak level. If you answer N, (i.e. you want to measure just a level,) then you will be prompted to hit RETURN to measure the peak level. Set the selected channel's input to this level, then hit RETURN. Otherwise, if you want to measure a pulse, answer by typing Y, or simply hitting RETURN. Then you are prompted for the pulse triggering threshold (in A/D units). A default, which will normally be appropriate, is shown in the prompt. You may specify a smaller value if previous attempts failed to find a pulse, or a larger value if you suspect that noise previously caused false-triggering. You are then prompted to hit RETURN to start scanning for the pulse. Once you do so, the selected channel will be sampled until a pulse is received, or until ten seconds have elapsed.
You will finally be prompted for the calibration level in microvolts. Enter the value and hit RETURN. The program then redisplays the updated settings, and the menu line.
You will be prompted for the gain factor (1, 2, 4 or 8 if the environment variable ADGAINTYPE is set to "2"; 1, 4, 16 or 64 if ADGAINTYPE is 4, which is the default if it's not set; or powers of ADGAINTYPE otherwise). Enter the value and hit RETURN. The program then redisplays the updated settings, and the menu line. If your hardware does not support programmable gain (if ADGAINTYPE is set to 1), then you'll just get a warning to that effect rather than being asked for the gain, and the gain code will be reset for all channels.
The File selection allows you to store the calibration information in a printable ASCII text file. You will be prompted to enter the file name. If you enter a file name, the text will be stored in this file. If the file already exists, it will be overwritten.
The Printer selection allows you to print the calibration information directly to the printer. The lp program is invoked to print the displayed text. Before beginning this operation, make sure the printer is powered up, on-line, and ready to print.
The Quit selection returns you to the previously displayed menu.
The Video selection does not send the text directly to the printer, but instead produces a printed copy of the video display's current contents - a screen dump - by invoking sdump(1). The same thing can be accomplished by pressing the quit key, normally Control-B. The Print/Video operation has the advantage that it can be used even when the program is reading its commands from a file, rather than the terminal. Also, the Print/Video operation clears the menu area before performing the screen dump.
Note that if there are more channels than can be displayed on screen at once, only a partial set of channels will be shown, and you will be able to scroll through using the arrow keys or + and - keys as described below.
The default.cal file is the only calibration file that the cap program (and the cavg(1) program) can use. The cap program will look first in the current directory, and then in /usr/neuro/lib for the file default.cal. If you created other .cal files in the current directory, you must copy the one you want to use to default.cal, before you run cap. E.g.:
The information in default.cal is only used for capture. The cap program writes this information in the run header (at the start of the .frm file), for all channels used in the capture. Programs that display data from the captured traces or waveforms will make use of the calibration information in the run header, not in default.cal.
Channel names and calibration values can be modified after data capture. You can use the calibrate program to update your default.cal file, then use fixcal (usually with the -f option) to transfer the new calibration to any .frm file.
The file format is simply an array of calinfo structures, one for each channel on the A/D converter, as described in frmfile(5). Historically, calibration files had information for only 16 channels. Now that A/D converters with more channels are supported, the length of the calibration file will vary depending on the number of channels of the A/D converter on the system that creates the file.