Acquire Analog Input Data Using an Analog Trigger--Multiple Times
This VI retrieves the specified amount of data from one or more analog input channels each time an analog trigger occurs. It shows how to start a triggered acquisition multiple times while avoiding the overhead of configuration and buffer allocation each time. This is a timed acquisition, meaning that a hardware clock is used to control the acquisition rate for fast and accurate timing. It is also a buffered acquisition, meaning that the data are stored in an intermediate memory buffer after they are acquired from the DAQ board. When the pretrigger scans is set to 0, the analog trigger circuitry on the board causes the board to acquire data when the trigger parameters are met. When the pretrigger scans is set to greater than 1, data are continuously acquired by the board, but are not transfered to a software buffer until after the analog trigger parameters are met. Once met, the data are transfered to the software buffer. Data are retrieved from that buffer and displayed after the appropriate amount (before and after the trigger) have been acquired. The vertical cursor on the graph indicates where the trigger occurred. With each iteration of the while loop, the VI waits for the next trigger, then reads the same amount of data again from the same channels at the same rate.
Use this VI to wait for multiple analog triggers, acquiring a relatively small amount of data for each trigger (it must fit in the memory available), where each point does not need to be viewed or processed while it is being acquired
INSTRUCTIONS:
1. Enter the device number, channels, trigger channel, number of scans to acquire, and the scan rate.
2. Enter the pretrigger scans, trigger slope, trigger level, and time limit.
3. Make the appropriate I/O connections as explained below.
4. Run the VI.
KEY PARAMETERS:
This VI shows how to use the intermediate analog input DAQ VIs to hardware trigger multiple acquisitions.
AI Config.vi is only called on the first iteration of the while loop. This avoids the overhead of configuration and buffer allocation for each acquisition. However, you must stop and restart the VI if you wish to change input parameters.
The "read/search mode" for AI Read.vi is set to "relative to trigger point", since this is a hardware analog triggered acquisition.
AI Control.vi (an advanced analog input VI) is called, in the event that AI Read.vi times out, to momentarily stop the analog input clock. This is needed so the input clock is not running when AI Start.vi (which restarts the clock) is called again.
With E Series devices, if your analog trigger signal is connected to one of the analog input channels, that channel must be first in the scan list of channels. If you are using named channels, the trigger channel must be the first channel in the actual hardware channel order, which may or may not be the first channel in the channel string control. This restriction does not apply if you connect the analog trigger signal to PFI0. Also, if pretrigger scans is greater than 1, you must either:
1. make your trigger channel and channel the same and only acquire from one channel.
2. use PFI0 as your trigger channel if you want to acquire from more than 1 channel.
I/O CONNECTIONS:
Connect to the input channels on the I/O connector for your board to match the channel you have chosen on the front panel of this VI. For example ACH0 for analog input.
To find the actual pin numbers, refer to your hardware user manual.
DAQ VIs USED:
AI Config.vi, AI Start.vi, AI Read.vi, AI Control.vi, AI Clear.vi.
***NOTE: This example uses the Traditional NI-DAQ (Legacy) driver. NI-DAQmx is the latest data acquisition driver provided by National Instruments. We recommend using the NI-DAQmx equivalent of this example (linked below). Please refer to the related links for more information on NI-DAQmx.
Requirements
Filename: 1271.zip
Software Requirements
Application Software: LabVIEW Full Development System 5.0.1
Language(s): LabVIEW
Hardware Requirements
Hardware Group: Multifunction DAQ (MIO)
Driver: Traditional NI-DAQ (Legacy)
Reader Comments | Submit a comment »
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
