Choose the Right Trigger and Get the Right Data
You'll get more useful data if you first determine which combination of hardware and software triggers are appropriate for your application.
Chad Chesney and Josh Martin, National Instruments, Austin, TX -- Test & Measurement World, 2/1/1999
| When you take measurements with a
data-acquisition system, you often must program the system to get the right amount of data
at the right time. The way you initiate, or trigger, the acquisition makes a significant
difference in the quality of the data you collect. By learning about your options,
youll know which combination of hardware and software triggers to use and whether
the triggers should be analog or digital. Different events require different triggers. When you measure a batterys discharge rate, for example, you may not need a precise acquisition start time; a software trigger may be all you need. Software triggers are easy to develop. You program the system to start an acquisition when a software event occurs, such as when a program starts or when you click on a button on a user screen. Listing 1 contains some code for a software trigger. Once you start the program, the system acquires 1000 samples at 1 ksample/s.
Many data-acquisition applications require
software triggers only. Applications that employ triggers beyond basic software triggering
usually do so to reference the acquisition to an external event or time. For example, when
you measure vibration in a crash test, you may need to capture data for the 10 ms that
immediately follow the impact. The acquisition must trigger at a specific time, based on
an analog voltage proportional to vibration. Here, you need an analog hardware trigger. Trigger on a Level A hardware analog trigger requires a separate circuit that digitizes the analog signal on which you base the trigger decision. When the signal of interest meets the specified level and slope conditions, the trigger circuit initiates the acquisition. In the case of the car crash, you might use a hardware analog trigger because acquisition need not begin until impact occurs. If you set the trigger level properly, you wont get a false trigger caused by minor changes in the trigger signal. And you get only the time span you need. The code in Listing 2 illustrates how to acquire 1000 samples at 10 ksamples/s when the input signal increases through 3.0 V.
With a digital trigger, your system begins an
acquisition on the transition of a digital signal. You can trigger the acquisition on
either a rising edge or falling edge. If your equipment monitors the vibration or power
consumption of an electric motor, then you may need a digital trigger. If a digital signal
starts or stops the motor, you can use that signal to trigger your data-acquisition
system. Pre or Post-Trigger? A pretriggered acquisition, initiated by a stop trigger, collects data before and after the trigger event occurs. If you want to perform a pretriggered acquisition, you can set up your system to begin digitizing on a software trigger, collect data, and place the data into a memory buffer. When the stop trigger occurs, the ADC continues to collect a predetermined number of samples. When you use a pretrigger you must preset the number of pretrigger and post-trigger samples the system will acquire. You can set up a digital post-triggered acquisition; the system acquires data only after the trigger signal occurs and the motor starts. Alternatively, you can use a pretriggered acquisition if you need the data around the time of an event, such as a motor shutdown. The system starts acquiring data based on a software command while the motor runs, and the power-off signal becomes the stop trigger. You can program the system to acquire a specific number of points before and after that trigger. T&MW Chad Chesney is the data acquisition product marketing manager and Josh Martin is an applications engineer at National Instruments. |


















