Tbkreadcalfile, Tbkselectport – Measurement Computing TempBook rev.3.0 User Manual
Page 79

TempBook User’s Manual
tbkCommand Reference (Standard API) 9-19
tbkReadCalFile
DLL Function
tbkReadCalFile(char *calfile);
C
tbkReadCalFile(char *calfile);
QuickBASIC
BtbkReadCalFile% (ByVal calfile$)
Visual Basic
VBtbkReadCalFile% (ByVal calfile$)
Turbo Pascal
tbkReadCalFile(calfile : string) : integer;
Parameters
char *calfile
The file name with optional path information of the calibration file. If calfile is NULL or empty (""), the
default calibration file TEMPBOOK .CAL will be read.
Returns
TerrNoError
- No error
TerrInvCalfile
- Error occurred while opening or reading calibration file
See Also
tbkCalSetup, tbkCalConvert, tbkCalSetupConvert
Program References
None
tbkReadCalFile
is the initialization function for reading in the calibration constants from the
calibration text file. This function, which is usually called once at the beginning of a program, will
read all the calibration constants from the specified file. If calibration constants for a specific gain
setting are not contained in the file, ideal calibration constants will be used, essentially performing
no calibration for that channel. If an error occurs while trying to open the calibration file, ideal
calibration constants will be used for all channels and a non-zero error code will be returned by the
tbkReadCalFile
function.
See the Software Calibration and Zero Compensation chapter for a complete description of
calibration.
tbkSelectPort
DLL Function
int tbkSelectPort(uchar lptPort);
C
tbkSelectPort(unsigned int lptPort);
QuickBASIC
BtbkSelectPort% (ByVal lptPort%)
Visual Basic
VBtbkSelectPort% (lptPort%)
Turbo Pascal
tbkSelectPort( lptPort:byte ):integer;
Parameters
uchar lptPort
The LPT port number (see table below for definitions.)
Description
Value
LPT1
0x00
LPT2
0x01
LPT3
0x02
LPT4
0x03
Returns
TerrNotOnLine
- No communications with TempBook
TerrBadChannel
- Invalid LPT channel
TerrNoTempBook
- No TempBook/66 detected
TerrNoError
- No error
See Also
Program References
tbkSelectPort
selects an initialized TempBook. This function causes any subsequent function
calls to be performed on this TempBook. Because tbkInit initializes then selects a TempBook,
tbkSelectPort
is only needed when using multiple TempBooks.
Note: tbkInit must be called with the corresponding LPT port before tbkSelectPort can
select it.