M-Series: Finite Correlated Digital Input with Analog Input - C#.NET
Downloads
Filename: finite_cdi_ai_intclk.zip
Requirements: View
Instructions for Running:
1. Select the analog physical channel to correspond to where your analog 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. Set the rate of the acquisition. Also set the number of samples to read.
Note: The rate should be at least twice as fast as the maximum frequency component of the signal being acquired.
4. Select the digital physical port on which your digital input will be acquired.
5. Select the correlated clock to use for your Digital output. NOTE THAT NOT ALL SELECTABLE TERMINALS ARE CLOCKS!
In this example "/Dev/ai/SampleClock" should be used.
Coding Steps:
1. Create new tasks and an analog input voltage channel using the CreateVoltageChannel method, and a digital input voltage channel through DIChannels.CreateChannel.
2. Configure Timing Specifications, using the Task.Timing.ConfigureSampleClock method. For the Digital Clock, use the "Correlated Clock" input as the source.
3. Create the AnalogMultiChannelReader object and use the AnalogMultiChannelReader.BeginReadMultiSample method to register the callback. Do the same for the digital task using DigitalSingleChannelWriter and BeginWriteMultiSamplePort. Read the analog data in the callback function and stop both tasks once both callbacks have been called.
4. Call Task.Dispose to stop the tasks and de-allocate any resources used by the tasks.
5. Handle any DaqExceptions and display any errors.
Requirements
Filename: finite_cdi_ai_intclk.zip
Software Requirements
Application Software: Measurement Studio Enterprise Edition System (Full Development System) 7.1, Measurement Studio .NET Support 7.1
Language(s): C#
Additional Software: Visual Studio .NET 2003
Hardware Requirements
Hardware Group: Multifunction DAQ (MIO)
Hardware Model: PCI-6221 (37-Pin), PCI-6289, PCI-6224, PCI-6225, PCI-6229, PCI-6230, PCI-6250, PCI-6251, PCI-6254, PCI-6259, PCI-6221, PCI-6280, PCI-6281, PCI-6284, PCI-6222
Driver: NI-DAQmx 7.5
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/).
