DAQmx .NET - Acquire Finite Voltage with Analog Reference Trigger
Downloads
Filename: acqvoltage_analogreftrigger.zip
Requirements: View
This example demonstrates how to acquire a finite amount of data using an internal clock and an analog reference trigger.
Instructions for Running:
1. Select the physical channel to correspond to where your signal is input on the DAQ device.
2. Enter the minimum and maximum voltage ranges.
Note: For better accuracy try to match the input ranges to the expected voltage level of the measured signal.
3. Select the number of samples per channel to acquire.
4. Set the Rate in Hz for the internal clock.
Note: The rate should be at least twice as fast as the maximum frequency component of the signal being acquired.
5. Set the source of the reference trigger, the polarity of the reference edges, and the analog level at which to trigger. Additionally, set the number of pre-trigger samples to be acquired.
Note: For M Series devices you should be using APFI0 instead of PFI0 for the source of the reference trigger.
Steps:
1. Create a new task and an analog input voltage channel.
2. Configure Timing Specifications.
3. Configure the Reference Trigger.
4. Start the Task and tell the board to start acquiring data with BeginReadMultiSample.
5. Inside the callback, read all the voltage samples and stop the task with EndReadMultiSample.
6. Dispose the task to release resources
I/O Connections Overview:
Make sure your signal input terminal matches the Physical Channel I/O Control. In this case wire your signal to the ai0 pin on your DAQ Device. By default, the signal routed to PFI0 will be used as the analog reference trigger. PFI0 is the default Analog Trigger pin for E Series devices. For more information on the input and output terminals for your device, open the NI-DAQmx Help, and refer to the NI-DAQmx Device Terminals and Device Considerations books in the table of contents.
Recommended use:
Create a Task. Create the Channel object and configure its parameters. Call Task.Dispose to stop the task and to de-allocate any resources used by the task. If you are acquiring data from a single channel, use the AnalogSingleChannelReader object instead of the AnalogMultiChannelReader. The former is optimized for reading acquisition data from a single channel.
Requirements
Filename: acqvoltage_analogreftrigger.zip
Software Requirements
Language(s): Visual Basic .NET, C#
Additional Software: Visual Studio 7.0
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/).
