Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Sep 6, 2006

Acquire Analog Input Using an Analog Software Trigger and External Scan Clock

0 ratings | 0.00 out of 5
Print

Downloads

Filename: 1159.zip
Requirements: View

This VI retrieves the specified amount of data from one or more analog input channels when a software analog trigger occurs. This VI uses an external scan clock to continually retrieve data from one or more analog input channels. This VI will only work on devices where you can externally connect a scan clock signal. This is a buffered acquisition, meaning that the data are stored in an intermediate memory buffer after they are acquired from the DAQ board. Since this VI uses a software analog trigger, data are continuously acquired with LabVIEW checking the intermediate buffer for the analog trigger specifications to be met. Once met, this VI retrieves and displays data from that buffer after the appropriate amount of data (before and after the trigger) have been acquired. The vertical cursor on the graph indicates where the trigger occurred. For simplicity, this VI uses AI Start.vi to configure the scan clock. However, for different types of connections on the E-series devices (other than the default), a clock source string specification is necessary. For this you would need to expand AI Start.vi into its Advanced subVIs.
Use this VI to wait for a software analog trigger while supplying your own scan clock, acquiring a relatively small amount of data (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, and number of scans to acquire.
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 software trigger an acquisition with an external scan clock.
Calculate Buffer Size.vi is used to allocate a buffer which is the larger of 1000 scans or 2.5 times the "number of scans to acquire". This tries to provide enough cushion for the driver to keep up in searching for the trigger condition while data are acquired. It is still possible for the VI to overflow the buffer or time-out if the acquisition speed is high.
Set up Conditional Retrieval.vi provides trigger parameters, the trigger channel index, and turns on conditional retrieval in AI Read.vi.
The "read/search mode" for AI Read.vi is set to "relative to end of data". This assures that LabVIEW checks the most recently acquired data (end of data) for the software trigger.

I/O CONNECTIONS:
Connect to the input channels on the I/O connector for your board to match the channels you have chosen on the front panel of this VI. For example ACH0 for analog input channel 0.
E series boards:
Connect your scan clock to PFI7/STARTSCAN.
Legacy MIO boards:
Connect your scan clock to OUT2. NOTE: You must scan 2 or more channels when specifying an external scan clock.
Legacy MIO-16X, MIO-16F-5, and MIO-64F-5:
Connect your scan clock to OUT2. NOTE: You must scan 2 or more channels when specifying an external scan clock.
Lab/1200 series boards:
Connect your scan clock to OUTB1.
The PC-LPM-16, DAQCard-500, and DAQCard-700 are not supported by this example.
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 Clear.vi.

Requirements


Filename: 1159.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)

 
0 ratings | 0.00 out of 5
Print

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/).