Text preview for : 3100TriggeredScan.pdf part of Keithley 3100TriggeredScan Keithley KPCI 3100TriggeredScan.pdf



Back to : 3100TriggeredScan.pdf | Home

Page 1 of 4
Triggered Scan Mode of KPCI3100 Driver
Preface

This note is intended to clarify use of external clocks and how to make use of the triggered scan
mode of the boards covered by the KPCI3100 series driver: KPCI-3101/2/3/4 or KPCI-3116 or
KPCI-3110.

Note: The example Visual Basic 6.0 code provided here is written for KPCI-3110. If you are using
a different board please reference the corresponding DriverLINX manual, as some service
request parameters may be different.

External Clocks

There are two scenarios to consider: Suppose the application requires one sample in response
to an external pulse train. In this case, a straightforward use of external clock is called for. In a
second situation, suppose the application requires multiple samples in response to each external
pulse. In this case, an externally clocked burst mode type of acquisition should be used.

One Sample per External Pulse: Use this when you want the A/D to acquire one sample for
each external clock pulse. Selection of rising or falling edge of the external clock is supported by
some hardware. However, boards covered by the KPCI3100 driver uses only the falling edge of
the external clock.

Waiting for ext CLK



A/D Sample CLK = Ext TTL signal




Application Acquire each sample per Application stops on user
started by the Ext Clock tic (falling edge specified event.
user event. in this case)


External Rate Clock
Below is some VB code for setting up a task that will acquire one data point for each external
clock pulse. A total of 128 samples will be acquired (two buffers of 64 samples) from 4 channels
at an estimated rate of 200 Hz. When both buffers have been filled, the task will stop
automatically (TCEVENT). The external signal should be connected to the external clock input of
the KPCI-3100 Series board.

This code snippet assumes the driver has already been loaded and the hardware initialized. It
does not show processing of the data in the BufferFilled event. See the DriverLINX Tutorial
Manual (web site document center) for a more complete coding discussion in both VC++ and VB,
or check the download center of the web site for available example programs.




KEITHLEY
Page 2 of 4
Triggered Scan Mode of KPCI3100 Driver




VB Example for External Rate Clock Acquisition (Written for KPCI-3110)

With SR_AI
.Req_subsystem = DL_AI
.Req_mode = DL_DMA
.Req_op = DL_START
.Evt_Str_type = DL_COMMAND
.Evt_Stp_type = DL_TCEVENT
.Evt_Tim_type = DL_RATEEVENT
.Evt_Tim_rateMode = DL_RATEGEN 'choose the rate clock
.Evt_Tim_rateChannel = DL_DEFAULTTIMER

.Evt_Tim_rateClock = DL_EXTERNAL
'You need to connect your external CLK source to External A/D Clock line(Pin 76 of STP-3110)
'When you click start, the board will wait for the falling edge of external CLK Signal.

.Evt_Tim_ratePeriod = .DLSecs2Tics(DL_DEFAULTTIMER, 1 / 200)
` This value is NOT actually used. However, DriverLINX requires a valid hardware value in case the
`application requests a timebase operation and to optimize data transfer between the
`driver and the application.

.Evt_Tim_rateGate = DL_DISABLED
.Sel_chan_format = DL_tNATIVE
.Sel_chan_N = 2 ` There will be start and stop channel
.Sel_chan_start = 0 'start scanning ch 0
.Sel_chan_startGainCode = .DLGain2Code(-1) '-1 means bipolar input, unity gain
.Sel_chan_stop = 3 'stop at channel 3
.Sel_chan_stopGainCode = .DLGain2Code(-1)
.Sel_buf_N = 2 '# of buffers
.Sel_buf_samples = 64 ' # of samples per buffer
.Sel_buf_notify = DL_NOTIFY ' send buffer filled messages
.Res_Sta_typeStatus = DL_IOSTATUS
.Refresh
End With


Note: