When to use External Trigger vs. External Clock

Similar documents
DT9834 Series High-Performance Multifunction USB Data Acquisition Modules

Auxiliary states devices

Image Acquisition Technology

NI-DAQmx Device Considerations

DT9837 Series. High Performance, USB Powered Modules for Sound & Vibration Analysis. Key Features:

Major Differences Between the DT9847 Series Modules

DNA-STP-SYNC Synchronization and Screw Terminal Panel. User Manual

ni.com Sensor Measurement Fundamentals Series

2 MHz Lock-In Amplifier

Dual Link DVI Receiver Implementation

AI-1204Z-PCI. Features. 10MSPS, 12-bit Analog Input Board for PCI AI-1204Z-PCI 1. Ver.1.04

Scanning For Photonics Applications

DT3162. Ideal Applications Machine Vision Medical Imaging/Diagnostics Scientific Imaging

DDA-UG-E Rev E ISSUED: December 1999 ²

EAN-Performance and Latency

PLASMA MONITOR (PT20 UVVis) USER GUIDE

Users Manual FWI HiDef Sync Stripper

Sapera LT 8.0 Acquisition Parameters Reference Manual

AI-1616L-LPE. Features. High-precision Analog input board (Low Profile size) for PCI Express AI-1616L-LPE 1. Ver.1.02 Ver.1.01

Application Note AN-708 Vibration Measurements with the Vibration Synchronization Module

SignalTap Analysis in the Quartus II Software Version 2.0

A New "Duration-Adapted TR" Waveform Capture Method Eliminates Severe Limitations

DT9857E. Key Features: Dynamic Signal Analyzer for Sound and Vibration Analysis Expandable to 64 Channels

Automatic Projector Tilt Compensation System

Solutions to Embedded System Design Challenges Part II

Model 6010 Four Channel 20-Bit Audio ADC Data Pack

A MISSILE INSTRUMENTATION ENCODER

SignalTap Plus System Analyzer

RedLab-1616HS-BNC User's Guide

PCM ENCODING PREPARATION... 2 PCM the PCM ENCODER module... 4

Chapter 9 Introduction to Sequential Logic

Encoders and Decoders: Details and Design Issues

USB-1616HS-4. High-Speed Analog Input and Digital I/O. User's Guide

ECE 4220 Real Time Embedded Systems Final Project Spectrum Analyzer

Session 1 Introduction to Data Acquisition and Real-Time Control

Workshop 4 (A): Telemetry and Data Acquisition

More on Flip-Flops Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <98> 98

Section 4. Display Connector

Sequential Logic Basics

4 MHz Lock-In Amplifier

DaqBoard/3000USB Series USB 1 MHz, 16-Bit Data Acquisition Boards

Low Power VLSI Circuits and Systems Prof. Ajit Pal Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

SignalTap: An In-System Logic Analyzer

Using SignalTap II in the Quartus II Software

C8000. sync interface. External sync auto format sensing : AES, Word Clock, Video Reference

Part No. ENC-LAB01 Users Manual Introduction EncoderLAB

PHYSICS 5620 LAB 9 Basic Digital Circuits and Flip-Flops

ELEN Electronique numérique

SIGNALtm Timer System

Common Spatial Patterns 3 class BCI V Copyright 2012 g.tec medical engineering GmbH

Pre-processing of revolution speed data in ArtemiS SUITE 1

SigPlay User s Guide

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

Brain-Computer Interface (BCI)

R&S TS-PIO4 Digital Functional Test Module 32-channel programmable digital I/O module

Laboratory Exercise 4

DT3130 Series for Machine Vision

CONVOLUTIONAL CODING

HIGH SPEED ASYNCHRONOUS DATA MULTIPLEXER/ DEMULTIPLEXER FOR HIGH DENSITY DIGITAL RECORDERS

BUSES IN COMPUTER ARCHITECTURE

MICROLINK 304x A-D Converter User Manual

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

AD16-64(LPCI)LA. Non-isolated high precision analog input board for Low Profile PCI AD16-64(LPCI)LA 1. Ver.1.01

D Latch (Transparent Latch)

GFT Channel Slave Generator

Common Spatial Patterns 2 class BCI V Copyright 2012 g.tec medical engineering GmbH

PicoScope 6407 Digitizer

CSC Computer Architecture and Organization

Dual Link DVI Receiver Implementation

Physics 120 Lab 10 (2018): Flip-flops and Registers

PASS. Professional Audience Safety System. User Manual. Pangolin Laser Systems. November 2O12

ATS MS/s 8-Bit PCI Digitizer

D-Lab & D-Lab Control Plan. Measure. Analyse. User Manual

Product Information. EIB 700 Series External Interface Box

AI-1664LAX-USB. Features. 100KSPS 16-bit Analog Input Unit for USB AI-1664LAX-USB 1. Ver.1.01

Personal Daq/3000 Series USB 1-MHz, 16-Bit Multifunction Modules

IRIG-B PTP Clock Converter Output Module Hardware Installation Manual

Logic Design Viva Question Bank Compiled By Channveer Patil

Patchmaster. Elektronik. The Pulse generator. February 2013

Laboratory Exercise 7

QUAD TRON, INC. 303 Camars Drive Phone: (215) Warminster, PA Fax: (215)

FPGA Laboratory Assignment 4. Due Date: 06/11/2012

Plog rev 1.0 MANUAL Overview

Artisan Technology Group is your source for quality new and certified-used/pre-owned equipment

EE 367 Lab Part 1: Sequential Logic

R Fig. 5 photograph of the image reorganization circuitry. Circuit diagram of output sampling stage.

Synthesis Technology E102 Quad Temporal Shifter User Guide Version 1.0. Dec

USB-1616HS-4 User's Guide

CPS311 Lecture: Sequential Circuits

HCImage Live Getting Started Guide

National Instruments Synchronization and Memory Core a Modern Architecture for Mixed Signal Test

DATUM SYSTEMS Appendix A

Revision 1.2d


THE LXI IVI PROGRAMMING MODEL FOR SYNCHRONIZATION AND TRIGGERING

Agilent Parallel Bit Error Ratio Tester. System Setup Examples

MBI5050 Application Note

IT T35 Digital system desigm y - ii /s - iii

Using a Photron FASTCAM APX RS High-Speed Camera with MiDAS DA

The University of Texas at Dallas Department of Computer Science CS 4141: Digital Systems Lab

Transcription:

Page 1 of 7 Preface This note is intended to clarify some of the issues you may need to consider when an application requires some sort of synchronization with external signals. Even though the discussion here is intended for Keithley KPCI-3100 family (KPCI-3101/02/03/04 or KPCI-3110/16 series) boards, most of the considerations are generally applicable to all plug-in board products. Consider a shaft encoder. Often the encoder will provide both a continuous stream of pulses as a function of rotation as well as a single pulse for each complete rotation (index pulse). One use case would be to acquire one or more data point with the plug-in board in response to each index pulse. Do you connect this pulse to the trigger or to the external clock of the board? Another use case would be acquisition of one or more data points in response to each rotation pulse from the encoder to deliver some data relative to position. Again, do you connect to the external clock or to the trigger of the board? The answer depends on the frequency of the external signals and the amount of data to be acquired in response to each external pulse. External Triggers When using a digital trigger, the task is defined to use a DI_EVENT as the start type. However, in order for the board to be sensitive to this trigger, the task must be armed (active). When the trigger occurs, the specified numbers of samples are acquired according to the specified rate until the stop condition is satisfied. In order to be able to respond to a new trigger pulse, the task must both complete and be rearmed. This puts a burden onto the controlling software to monitor the state of the task (active or not) and to re-arm the task before the next trigger occurs. Each task can have a few milliseconds of overhead in addition to the actual time required for the acquisition. This limits the repeat rate of the external trigger to less than 500Hz and will have computer-to-computer variation in the actual number. The diagram below represents the relationship between arming the task, the occurrence of the trigger and the start of acquisition. Waiting for trigger External trigger occurs Ext TTL Signal A/D Sample started by the user. Acquisition starts on external trigger. (rising edge trigger in this case) Acquisition stops on user specified event. (e.g. terminal count or Stop on command (such as push button)). Post-Trigger Acquisition.

Page 2 of 7 Below is some VB code for setting up a task that will start on the rising edge of a digital trigger, and then acquire 64 samples (two buffers of 32 samples) from 4 channels at a rate of 200 Hz. When both buffers have been filled, the task will stop automatically (TCEVENT). 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 procedure nor use of the StartEvent message that will be sent when the trigger does occur. 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. 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.

Page 3 of 7 VB Example for rising edge Post Trigger Acquisition with external TTL signal (Written for KPCI- 3110) With SR_AI.Req_subsystem = DL_AI.Req_mode = DL_DMA.Req_op = DL_START 'Set up the digital trigger. Acquisition starts on the rising edge of external TTL signal 'Connect the trigger signal on AD TTL Trigger line (Pin 77 of STP-3110).Evt_Str_type = DL_DIEVENT.Evt_Str_diChannel = 3 'use 3 for KPCI-3110/16 & 4 for KPCI-3101/02/03/04.Evt_Str_diMask = 1.Evt_Str_diMatch = DL_NotEquals.Evt_Str_diPattern = 0 ' 0 = rising edge, 1 = falling edge '---------------------------- ' SR set up for Paced Acquisition with 4 channels at 200Hz.Evt_Stp_type = DL_TCEVENT.Evt_Tim_type = DL_RATEEVENT.Evt_Tim_rateMode = DL_RATEGEN.Evt_Tim_rateChannel = DL_DEFAULTTIMER.Evt_Tim_rateClock = DL_INTERNAL1 ' use internal clock.evt_tim_rateperiod =.DLSecs2Tics(DL_DEFAULTTIMER, 1/200) ' major period.evt_tim_rategate = DL_DISABLED.Sel_chan_format = DL_tNATIVE.Sel_chan_N = 2 'means it will have start and stop channels, does NOT mean 2 channels.sel_chan_start = 0 'start channel.sel_chan_startgaincode =.DLGain2Code(-1) '-1 means bipolar input, unity gain.sel_chan_stop = 3 'stop channel.sel_chan_stopgaincode =.DLGain2Code(-1).Sel_buf_N = 2 '# of buffers.sel_buf_samples = 32 ' # samples per buffer.sel_buf_notify = DL_NOTIFY + DL_NOTIFY_START.Res_Sta_typeStatus = DL_IOSTATUS ' status about the operation.refresh End With

Page 4 of 7 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. This will effectively yield the same type of data pattern as the start on digital trigger task provides, but the task remains active between successive pulses so can be operated at much higher repeat rates. 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 A/D Sample = Ext TTL signal started by the user event. Acquire each sample per Ext Clock tic (falling edge in this case) stops on user specified event. 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). 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. Note: The KPCI-3101/2/3/4 boards transfer data in no fewer than 16 samples. The KPCI-3110 and KPCI-3116 transfer data in no fewer than 32 samples. Therefore, the external clocking source should not suddenly stop at less than a multiple of the transfer size else data will be stranded in the board s FIFO. Even though the external clock controls the sample rate, DriverLINX requires an estimated rate (see the code snippet).

Page 5 of 7 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 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 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

Page 6 of 7 Multiple Samples per External Pulse: Use this when you want to synchronize scanning through several channels (or multiple samples from a single channel) with a recurring external pulse. For example, you can use External Burst Clock when you want to scan channel 0,1 & 2 every time there is an external TTL pulse. Major Period Waiting for ext started by the user event. Minor Period* CH 0 CH 1 CH 2 Burst Acquisition starts at the external clock (falling edge in this case) * Minor period CANNOT exceed the maximum sampling rate of the A/D. CH 0 CH 1 CH 2 Next scan begins at the falling edge of the next external pulse. External Burst Clock stops on user specified event. Ext A/D Sample In the above diagram, major period of the burst is provided by the external clock tic, and the onboard clock at a specified rate provides the minor period (faster burst clock). KPCI-3100 series boards have an additional feature when using this external burst clock that allow it to repeat the scan up to 256 times. However, as with all burst mode acquisitions, the burst mode scan must be completed before the next external clock tic occurs. Example: the following example (written for KPCI-3110/16) shows scanning the selected channels (channel 0 to 2) twice, in VB6.0. Major Period Ext Minor Period A/D Sample CH 0 CH 1 CH 2 CH 0 CH 1 CH 2 CH 0 CH 1 CH 2 CH 0 CH 1 CH 2 Burst Acquisition starts at the falling edge of external (KPIC3100). In this case the channel gain list is scanned twice. * Minor period CANNOT exceed the maximum sampling rate of the A/D. Next scan begins at the falling edge of external pulse.

Page 7 of 7 VB example for External Burst Clock with 2 scans through channels. (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 'stop when all buffers have been filled.evt_tim_type = DL_RATEEVENT.Evt_Tim_rateMode = DL_BURSTGEN 'choose the burst clock.evt_tim_ratechannel = DL_DEFAULTTIMER.Evt_Tim_rateClock = DL_EXTERNAL You need to connect your external source to AD TTL Trigger line (Pin 77 of STP-3110), not the external Clock line. Hardware will only work on the falling edge of the external 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_ratepulses = 6 Total six burst tics, i.e. 2 scans for the 3 channels..evt_tim_rateoncount =.DLSecs2Tics(DL_DEFAULTTIMER, 1 / 100000) 'Note that the minor period cannot exceed the maximum sampling rate of the A/D..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 at channel 0.Sel_chan_startGainCode =.DLGain2Code(-1) with bipolar gain of 1.Sel_chan_stop = 2 stop at channel 2; total of 3 channels used.sel_chan_stopgaincode =.DLGain2Code(-1) with bipolar gain of 1.Sel_buf_N = 3 ' 3 buffers.sel_buf_samples = 12 ' samples per buffer, two external pulses required for 12 samples.sel_buf_notify = DL_NOTIFY.Res_Sta_typeStatus = DL_IOSTATUS.Refresh End With Conclusion Selection of digital trigger or external clock (burst mode) is an important consideration when trying to synchronize acquisition from one or more channels with an external pulse. When the pulse will repeat at a fast rate, use of external clock (burst mode) is a more robust implementation than use of a digital trigger to start the acquisition. If you are not sure what method would work for your particular need, it is always a good idea to sketch out a timing diagram and see if it can be applicable to any of the topics discussed above.