Command summary, c language (standard api) – Measurement Computing TempBook rev.3.0 User Manual
Page 49

TempBook User’s Manual
Standard API Programming of the TempBook with C 6-17
Command Summary, C Language (Standard API)
Command
Description
Initialization, Communication and Error Handling:
tbkInit (uint lptPort, uchar lptIntr)
Establish communication with the TempBook at the specified LPT
port and interrupt
tbkSelectPort (uint lptPort)
Select an initialized TempBook as the current TempBook
tbkClose (void)
End communication with the TempBook
tbkSetErrHandler (tbkErrorHandlerFPT
tbkErrHandler)
Specify a user-defined routine to call when error occurs
tbkDefaultHandler (int tbkErrnum)
Default error handling routine
tbkGetProtocol (int *protocol)
Get the current parallel port communication protocol
tbkSetProtocol (int protocol)
Set the parallel port communication protocol
Separate Scan Sequence, Pacer Clock and Trigger Commands:
tbkSoftTrig (void)
Issue a software trigger to the TempBook
tbkSetFreq (float freq)
Set the pacer clock frequency
tbkGetFreq (float _far *freq)
Read the pacer clock frequency
tbkSetClk (uint ctr1, uint ctr2)
Set the pacer clock frequency divider registers
tbkSetMode (uchar di_se, uchar polarity)
Specify input signal type (single-ended or differential)
tbkSetMux (uint startChan, uint endChan, uchar
gain)
Setup the scan sequencer for a range of channels at the same
gain
tbkGetScan (uint *chans, uchar *gains, uchar
*polarity, uint *count)
Read the scan sequencer contents
Digital I/O and Counter/Timer Functions:
tbkSetScan (uint *chans, uchar *gains, uchar
*polarity, uint count)
Setup the scan sequencer with specific channels, gains, and
polarities
tbkSetTrig (uchar trigger, uchar oneShot, uchar
ctr0mode, uchar pacerMode)
Set the trigger source for analog data acquisition
Separate Data Read and Background Transfer Commands:
tbkRdFore (uint _far *sample)
Read a single ADC sample in the foreground and increment the
scan sequencer
tbkRdNFore (uint _far *buf, uint count)
Read multiple scans in the foreground
tbkRdNBack (uint _far *buf, uint count, uchar
cycle, uchar updateSingle)
Read multiple scans in the background using interrupts
tbkGetBackStat (uchar _far *active, uint long
_far *count)
Determine is a background transfer is still in progress
tbkStopBack (void)
Stop the background transfer
Data Read Commands with Combined Scan Sequencer, Pacer Clock and Trigger Setup and Thermocouple
Linearization:
tbkRd (uint chan, uint *sample, uchar gain)
Read a single sample from the specified channel
tbkRdN (uint chan, uint *buf, uint count, uchar
trigger, uchar oneShot, float uchar gain)
Read multiple samples from the specified channel
tbkRdScan (uint startChan, uint endChan, uint
*buf, uchar gain)
Read a single sample from the specified range of channels
tbkRdScanN (uint startChan, uint endChan, uint
*buf, uint count, uchar trigger, uchar oneShot,
float freq, uchar gain)
Read multiple samples from the specified range of channels
tbkRdTemp (uint chan, uint tcType, int temp)
Read the thermocouple temperature once from the specified
channel
tbkRdTempN (uint chan, uint tcType, uint count,
int *temp, uint *buf, float freq, uint avg)
Read the thermocouple temperature from the specified channel
multiple times with optional averaging
tbkRdTempScan (uint startChan, uint endChan, uint
tcType, int temp)
Read the thermocouple temperature once from each channel in a
range
tbkRdTempScanN (uint startChan, uint endChan,
uint tcType, uint count, int *temp, uint *buf,
float freq, uint avg)
Read the thermocouple temperature from each channel in a range
multiple times using optional averaging
Thermocouple Linearization Commands:
tbkTCSetup (uint nscan, uint cjcPosition, uint
ntc, uint tcType, uchar bipolar, uint avg)
Specify scan information used by tbkTCConvert
tbkTCConvert (uint _far *counts, uint scans, int
_far *temp, uint ntemp)
Perform thermocouple linearization on scan data
tbkTCSetupConvert (uint nscan, uint cjcPosition,
uint ntc, uint tcType, uchar bipolar, uint avg,
uint _far *counts, uint scans, int *far *temp,
uint ntemp)
Combined tbkTCSetup and tbkTCConvert
tbkTCAutoZero (uint zero)
Tell the thermocouple linearization functions that auto zeroing will
be used