Tbksettrig – Measurement Computing TempBook rev.3.0 User Manual
Page 85

TempBook User’s Manual
tbkCommand Reference (Standard API) 9-25
tbkSetTrig
DLL Function
int tbkSetTrig(uchar trigger, uchar one shot, uchar ctr0 mode, uchar pacer
Mode);
C
tbkSetTrig(unsigned char trigger, unsigned char oneShot, unsigned char
ctr0mode, unsigned char pacerMode);
QuickBASIC
BtbkSetTrig% (ByVal trigger%, ByVal oneShot%, ByVal ctr0mode%, ByVal
pacerMode%)
Visual Basic
VBtbkSetTrig% (ByVal trigger%, ByVal oneShot%, ByVal ctr0mode%, ByVal
pacerMode%)
Turbo Pascal
tbkSetTrig( trigger:byte; oneShot:byte; ctr0Mode:byte; pacerMode:byte
):integer;
Parameters
uchar trigger
The trigger source (see table at end of chapter for valid values)
uchar one Shot
A flag that if non-zero enables one-shot trigger mode, otherwise enables continuous mode
ctr0mode
A non-zero flag selects an internal 100 kHz clock to be the input to counter 0.
If the flag is zero, only the external clock is the input to counter 0.
See figure in
tbkConfCntr0
for detailed diagram.
pacer Mode
A flag that if zero, disables the external TTL Trigger from affecting the pacer clock.
If the flag is non-zero, any low-level on the TTL trigger will cause the pacer clock to pause.
Returns
TerrInvTrigSource
- Invalid trigger
TerrInvLevel
- Invalid level
TerrNoError
- No error
See Also
tbkConfCntr0
Program References
tbkSetTrig
sets and arms the trigger of the A/D converter. Eight trigger sources and several
mode flags can be used to generate a wide variety of acquisitions. The tbkSetTrig command
will stop any current acquisitions, empty the TempBook/66 of any data previously acquired and arm
the TempBook/66 using the specified trigger source.
The pacer clock trigger source can be used to acquire data at a constant frequency. The sampling
rate can be set using the tbkSetClk or tbkSetFreq functions. The one-shot flag has no
meaning when using this trigger source.
The software trigger source allows the user to trigger the A/D from software using the
tbkSoftTrig
function. When the one-shot mode is enabled, a single scan will be initiated by the
software trigger. In the continuous mode (one-shot disabled), sending a software trigger will cause
the A/D converter to sample at the rate of the pacer clock.
An external TTL pulse can be used to initiate a scan or start an acquisition when using the external
TTL rising or falling edge trigger source. The external TTL pulse should be applied to the trig
input. The pulse will initiate a single scan in one-shot mode and a continuous acquisition at the
pacer clock frequency in continuous mode.
Setting the counter 0 mode flag true will enable an onboard 100 kHz clock to be ANDed with the
counter 0 input to produce the input to counter 0. If nothing is connected to counter 0 input, the line
will float high essentially clocking counter 0 off the 100KHz clock. If this flag is false, counter 0
can only be clocked from the counter 0 input pin. Counter 0 can be used as an alternative trigger
source by connecting the counter 0 output to the trig input and choosing an external TTL trigger.
Counter 0 can also be used for general counter applications.
The pacer mode flag enables/disables operation of the pacer clock. If this flag is non-zero, the pacer
clock will be gated with the trig input. If it is zero, the pacer clock will be enabled.